summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/src/tls-socket.c
diff options
context:
space:
mode:
authorSteven Barth <steven@midlink.org>2009-02-27 14:51:37 +0000
committerSteven Barth <steven@midlink.org>2009-02-27 14:51:37 +0000
commit7196b2cd848577f640d9268a0a34ab3ad8706c26 (patch)
tree94b74ea2ba96fdc6135c6af807e925f064a2db28 /libs/nixio/src/tls-socket.c
parent30421d38dd004a8c1e149e40af2019cbbc4c8bd6 (diff)
nixio: Fixes, use POSIX calls for file i/o
httpclient: resume support, splice() support, cookie support
Diffstat (limited to 'libs/nixio/src/tls-socket.c')
-rw-r--r--libs/nixio/src/tls-socket.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/nixio/src/tls-socket.c b/libs/nixio/src/tls-socket.c
index b0cfb5c3f..3b0744f04 100644
--- a/libs/nixio/src/tls-socket.c
+++ b/libs/nixio/src/tls-socket.c
@@ -96,13 +96,15 @@ static int nixio_tls_sock_recv(lua_State *L) {
/* There is an error */
free(t->pbuffer);
t->pbuffer = t->pbufpos = NULL;
- t->pbufsiz = 0;
if (axread != SSL_ERROR_CONN_LOST) {
+ t->pbufsiz = 0;
return nixio__tls_sock_perror(L, sock, axread);
} else {
if (!t->pbufsiz) {
lua_pushliteral(L, "");
+ } else {
+ t->pbufsiz = 0;
}
}
} else {
@@ -198,6 +200,8 @@ static int nixio_tls_sock__tostring(lua_State *L) {
static const luaL_reg M[] = {
{"recv", nixio_tls_sock_recv},
{"send", nixio_tls_sock_send},
+ {"read", nixio_tls_sock_recv},
+ {"write", nixio_tls_sock_send},
{"accept", nixio_tls_sock_accept},
{"connect", nixio_tls_sock_connect},
{"shutdown", nixio_tls_sock_shutdown},
@@ -213,5 +217,5 @@ void nixio_open_tls_socket(lua_State *L) {
luaL_register(L, NULL, M);
lua_pushvalue(L, -1);
lua_setfield(L, -2, "__index");
- lua_setfield(L, -2, "tls_socket_meta");
+ lua_setfield(L, -2, "meta_tls_socket");
}