summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/tls-socket.c
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/src/tls-socket.c
parentcebe6f031bc475e8e21102c4b5e378e1fa7bcf54 (diff)
nixio: Finetuning of TLS-support
httpclient: HTTPS support axTLS: enable diagnostic mode
Diffstat (limited to 'libs/nixio/src/tls-socket.c')
-rw-r--r--libs/nixio/src/tls-socket.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/nixio/src/tls-socket.c b/libs/nixio/src/tls-socket.c
index b26d140b4..b0cfb5c3f 100644
--- a/libs/nixio/src/tls-socket.c
+++ b/libs/nixio/src/tls-socket.c
@@ -22,9 +22,8 @@
static int nixio__tls_sock_perror(lua_State *L, SSL *sock, int code) {
lua_pushnil(L);
- lua_pushinteger(L, code);
lua_pushinteger(L, SSL_get_error(sock, code));
- return 3;
+ return 2;
}
static int nixio__tls_sock_pstatus(lua_State *L, SSL *sock, int code) {
@@ -37,6 +36,10 @@ static int nixio__tls_sock_pstatus(lua_State *L, SSL *sock, int code) {
}
static SSL* nixio__checktlssock(lua_State *L) {
+ if (lua_istable(L, 1)) {
+ lua_getfield(L, 1, "connection");
+ lua_replace(L, 1);
+ }
nixio_tls_sock *sock = luaL_checkudata(L, 1, NIXIO_TLS_SOCK_META);
luaL_argcheck(L, sock->socket, 1, "invalid context");
return sock->socket;
@@ -186,7 +189,7 @@ static int nixio_tls_sock__gc(lua_State *L) {
static int nixio_tls_sock__tostring(lua_State *L) {
SSL *sock = nixio__checktlssock(L);
- lua_pushfstring(L, "nixio TLS socket: %p", sock);
+ lua_pushfstring(L, "nixio TLS connection: %p", sock);
return 1;
}