Changeset

11805:2327e03d1f8d

net.server_epoll: Fix indentation messed up in last merge Seems to have happened in 6427e2642976, probably because of Meld
author Kim Alvefur <zash@zash.se>
date Fri, 17 Sep 2021 12:42:04 +0200
parents 11804:22825cb5dcd8
children 11806:6f7d6712e250
files net/server_epoll.lua
diffstat 1 files changed, 27 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/net/server_epoll.lua	Wed Sep 15 18:39:37 2021 +0200
+++ b/net/server_epoll.lua	Fri Sep 17 12:42:04 2021 +0200
@@ -503,9 +503,9 @@
 	if ok then
 		self:set(nil, false);
 		if cfg.keep_buffers and type(buffer) == "table" then
-		for i = #buffer, 1, -1 do
-			buffer[i] = nil;
-		end
+			for i = #buffer, 1, -1 do
+				buffer[i] = nil;
+			end
 		else
 			self.writebuffer = nil;
 		end
@@ -515,10 +515,10 @@
 	elseif partial then
 		self:debug("Sent %d out of %d buffered bytes", partial, #data);
 		if cfg.keep_buffers and type(buffer) == "table" then
-		buffer[1] = data:sub(partial+1);
-		for i = #buffer, 2, -1 do
-			buffer[i] = nil;
-		end
+			buffer[1] = data:sub(partial+1);
+			for i = #buffer, 2, -1 do
+				buffer[i] = nil;
+			end
 		else
 			self.writebuffer = data:sub(partial+1);
 		end
@@ -560,9 +560,9 @@
 			local ret, err = self:onwritable();
 			self._opportunistic_write = nil;
 			return ret, err;
-	end
-	self:setwritetimeout();
-	self:set(nil, true);
+		end
+		self:setwritetimeout();
+		self:set(nil, true);
 	end
 	return #data;
 end
@@ -630,21 +630,21 @@
 function interface:inittls(tls_ctx, now)
 	if self._tls then return end
 	if tls_ctx then self.tls_ctx = tls_ctx; end
-		self._tls = true;
+	self._tls = true;
 	self:debug("Starting TLS now");
 	self:updatenames(); -- Can't getpeer/sockname after wrap()
-		local ok, conn, err = pcall(luasec.wrap, self.conn, self.tls_ctx);
-		if not ok then
-			conn, err = ok, conn;
+	local ok, conn, err = pcall(luasec.wrap, self.conn, self.tls_ctx);
+	if not ok then
+		conn, err = ok, conn;
 		self:debug("Failed to initialize TLS: %s", err);
-		end
-		if not conn then
-			self:on("disconnect", err);
-			self:destroy();
-			return conn, err;
-		end
-		conn:settimeout(0);
-		self.conn = conn;
+	end
+	if not conn then
+		self:on("disconnect", err);
+		self:destroy();
+		return conn, err;
+	end
+	conn:settimeout(0);
+	self.conn = conn;
 	if conn.sni then
 		if self.servername then
 			conn:sni(self.servername);
@@ -664,9 +664,9 @@
 				conn:settlsa(tlsa.use, tlsa.select, tlsa.match, tlsa.data);
 			end
 		end
-		end
-		self:on("starttls");
-		self.ondrain = nil;
+	end
+	self:on("starttls");
+	self.ondrain = nil;
 	self.onwritable = interface.tlshandshake;
 	self.onreadable = interface.tlshandshake;
 	if now then
@@ -975,10 +975,10 @@
 	from:debug("Linking to %s", to.id);
 	function from:onincoming(data)
 		self:pause();
-			to:write(data);
+		to:write(data);
 	end
 	function to:ondrain() -- luacheck: ignore 212/self
-			from:resume();
+		from:resume();
 	end
 	from:set_mode(read_size);
 	from:set(true, nil);