X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=package%2Fuhttpd%2Fsrc%2Fuhttpd.c;h=3563d91d16ef92ad12ed55cae69b410cc5aa2e84;hb=74e424738eadf88252e21638e0109a5c92a6f995;hp=50c3b32a94ff3e78c3f63b7d0a1fe6ca8c9b1bd6;hpb=80f4d421641a56c1fcdfacfad0a6223f25b3ec0e;p=openwrt.git diff --git a/package/uhttpd/src/uhttpd.c b/package/uhttpd/src/uhttpd.c index 50c3b32a94..3563d91d16 100644 --- a/package/uhttpd/src/uhttpd.c +++ b/package/uhttpd/src/uhttpd.c @@ -512,7 +512,22 @@ static void uh_mainloop(struct config *conf, fd_set serv_fds, int max_fd) #ifdef HAVE_TLS /* setup client tls context */ if( conf->tls ) - conf->tls_accept(cl); + { + if( conf->tls_accept(cl) < 1 ) + { + fprintf(stderr, + "tls_accept failed, " + "connection dropped\n"); + + /* close client socket */ + close(new_fd); + + /* remove from global client list */ + uh_client_remove(new_fd); + + continue; + } + } #endif /* add client socket to global fdset */ @@ -621,7 +636,7 @@ static void uh_mainloop(struct config *conf, fd_set serv_fds, int max_fd) } #ifdef HAVE_TLS -static inline uh_inittls(struct config *conf) +static inline int uh_inittls(struct config *conf) { /* library handle */ void *lib;