diff options
author | mrcsys | 2006-01-03 16:37:14 +0000 |
---|---|---|
committer | mrcsys | 2006-01-03 16:37:14 +0000 |
commit | 414d5b801e911340ca6bea110fc44e8f08042937 (patch) | |
tree | aeec5c8d7096b0d0e7155121691d4be3b4db70ca | |
parent | 7af6c6e297367d1422ed08fc167a1bd02bd43984 (diff) | |
download | csoap-414d5b801e911340ca6bea110fc44e8f08042937.tar.gz csoap-414d5b801e911340ca6bea110fc44e8f08042937.tar.bz2 |
In WIN32, we must set the socket to block before SSL accept.
-rw-r--r-- | nanohttp/nanohttp-ssl.c | 5 |
1 files changed, 5 insertions, 0 deletions
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); |