summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/lua
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-02-24 17:54:48 +0000
committerSteven Barth <steven@midlink.org>2009-02-24 17:54:48 +0000
commitff2bc9081bb24e42dec9ccd46cdb4c377333dc59 (patch)
treeea14c5b622e9d79f149e5d3e3f2490bf4f5331ce /libs/nixio/lua
parentcebe6f031bc475e8e21102c4b5e378e1fa7bcf54 (diff)
nixio: Finetuning of TLS-support
httpclient: HTTPS support axTLS: enable diagnostic mode
Diffstat (limited to 'libs/nixio/lua')
-rw-r--r--libs/nixio/lua/nixio/util.lua19
1 files changed, 17 insertions, 2 deletions
diff --git a/libs/nixio/lua/nixio/util.lua b/libs/nixio/lua/nixio/util.lua
index 5bfcc48d9..760ec8f82 100644
--- a/libs/nixio/lua/nixio/util.lua
+++ b/libs/nixio/lua/nixio/util.lua
@@ -14,7 +14,7 @@ $Id$
local table = require "table"
local nixio = require "nixio"
-local setmetatable, assert = setmetatable, assert
+local getmetatable, assert = getmetatable, assert
module "nixio.util"
@@ -22,6 +22,16 @@ local BUFFERSIZE = 8096
local socket = nixio.socket_meta
local tls_socket = nixio.tls_socket_meta
+function socket.is_socket(self)
+ return (getmetatable(self) == socket)
+end
+tls_socket.is_socket = socket.is_socket
+
+function socket.is_tls_socket(self)
+ return (getmetatable(self) == tls_socket)
+end
+tls_socket.is_tls_socket = socket.is_tls_socket
+
function socket.recvall(self, len)
local block, code, msg = self:recv(len)
@@ -133,4 +143,9 @@ function socket.blocksource(self, bs, limit)
end
end
end
-tls_socket.blocksource = socket.blocksource \ No newline at end of file
+tls_socket.blocksource = socket.blocksource
+
+function tls_socket.close(self)
+ self:shutdown()
+ return self.socket:close()
+end \ No newline at end of file