From 414d5b801e911340ca6bea110fc44e8f08042937 Mon Sep 17 00:00:00 2001 From: mrcsys Date: Tue, 3 Jan 2006 16:37:14 +0000 Subject: In WIN32, we must set the socket to block before SSL accept. --- nanohttp/nanohttp-ssl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'nanohttp/nanohttp-ssl.c') diff --git a/nanohttp/nanohttp-ssl.c b/nanohttp/nanohttp-ssl.c index 8921585..c2f578b 100644 --- a/nanohttp/nanohttp-ssl.c +++ b/nanohttp/nanohttp-ssl.c @@ -45,6 +45,7 @@ typedef unsigned int uint32_t; #include "nanohttp-ssl.h" #include "nanohttp-common.h" +#include "nanohttp-socket.h" #ifdef WIN32 @@ -309,7 +310,11 @@ SSL* init_ssl(SSL_CTX* ctx, int sock, int type) SSL_set_fd(ssl, sock); if(type == SSL_SERVER) { + hsocket_t sock_t; + sock_t.sock = sock; + hsocket_block(sock_t, 1); ret = SSL_accept(ssl); + hsocket_block(sock_t, 0); if(ret <= 0) { log_error1( "SSL accept error"); log_ssl_error(ssl, ret); -- cgit v1.1-32-gdbae