nixio util:
authorSteven Barth <steven@midlink.org>
Fri, 6 Mar 2009 16:34:26 +0000 (16:34 +0000)
committerSteven Barth <steven@midlink.org>
Fri, 6 Mar 2009 16:34:26 +0000 (16:34 +0000)
Don't shutdown TLS connection on close()
This could lead to problems when calling close on a forked socket
sink() also shutdown connection if close is requested and possible

libs/nixio/lua/nixio/util.lua

index f2ee2a27e781bf1e876f3451f262c3ab0de724fd..59bdce8f497a93c7b0de4fb85262ea392fbc9d61 100644 (file)
@@ -151,6 +151,9 @@ end
 function meta.sink(self, close)
        return function(chunk, src_err)
                if not chunk and not src_err and close then
+                       if self.shutdown then
+                               self:shutdown()
+                       end
                        self:close()
                elseif chunk and #chunk > 0 then
                        return self:writeall(chunk)
@@ -160,7 +163,6 @@ function meta.sink(self, close)
 end
 
 function tls_socket.close(self)
-       self:shutdown()
        return self.socket:close()
 end