summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy@warmcat.com>2011-02-14 21:14:37 +0000
committerAndy Green <andy@warmcat.com>2011-02-14 21:14:37 +0000
commit1f9bf527ec631d64e4a24295ea92dedae974db36 (patch)
tree9189c9df0b9b36ef5fa4212f1d9f206c78f848b1
parent038d582bde65bce7a36e727cdef8482fe86bdf20 (diff)
fix ssl support and confirm builds clean when not configuredrelease-0.4
Signed-off-by: Andy Green <andy@warmcat.com>
-rw-r--r--lib/libwebsockets.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c
index 0e64817..cf814ec 100644
--- a/lib/libwebsockets.c
+++ b/lib/libwebsockets.c
@@ -87,6 +87,19 @@ delete_from_fd(struct libwebsocket_context *this, int fd)
return 1;
}
+#ifdef LWS_OPENSSL_SUPPORT
+static void
+libwebsockets_decode_ssl_error(void)
+{
+ char buf[256];
+ u_long err;
+
+ while ((err = ERR_get_error()) != 0) {
+ ERR_error_string_n(err, buf, sizeof(buf));
+ fprintf(stderr, "*** %s\n", buf);
+ }
+}
+#endif
void
libwebsocket_close_and_free_session(struct libwebsocket_context *this,
@@ -402,7 +415,6 @@ libwebsocket_service_fd(struct libwebsocket_context *this,
#ifdef LWS_OPENSSL_SUPPORT
new_wsi->ssl = NULL;
- this->ssl_ctx = NULL;
if (this->use_ssl) {
@@ -411,6 +423,7 @@ libwebsocket_service_fd(struct libwebsocket_context *this,
fprintf(stderr, "SSL_new failed: %s\n",
ERR_error_string(SSL_get_error(
new_wsi->ssl, 0), NULL));
+ libwebsockets_decode_ssl_error();
free(new_wsi);
break;
}
@@ -1348,7 +1361,6 @@ static void sigpipe_handler(int x)
}
-
/**
* libwebsocket_create_context() - Create the websocket handler
* @port: Port to listen on... you can use 0 to suppress listening on