diff options
-rw-r--r-- | src/microhttpd/daemon.c | 9 | ||||
-rw-r--r-- | src/microhttpd/internal.h | 16 |
2 files changed, 16 insertions, 9 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 8405aa56..014e35e1 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -5495,8 +5495,11 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5495 | if (NULL == susp->urh) /* "Upgraded" connection? */ | 5495 | if (NULL == susp->urh) /* "Upgraded" connection? */ |
5496 | MHD_PANIC (_("MHD_stop_daemon() called while we have suspended connections.\n")); | 5496 | MHD_PANIC (_("MHD_stop_daemon() called while we have suspended connections.\n")); |
5497 | #ifdef HTTPS_SUPPORT | 5497 | #ifdef HTTPS_SUPPORT |
5498 | else if (used_tls && used_thr_p_c && MHD_NO == susp->urh->clean_ready) | 5498 | else if (used_tls && |
5499 | shutdown (urh->app.socket, SHUT_RDWR); /* Wake thread by shutdown of app socket. */ | 5499 | used_thr_p_c && |
5500 | (MHD_NO == susp->urh->clean_ready) ) | ||
5501 | shutdown (urh->app.socket, | ||
5502 | SHUT_RDWR); /* Wake thread by shutdown of app socket. */ | ||
5500 | #endif /* HTTPS_SUPPORT */ | 5503 | #endif /* HTTPS_SUPPORT */ |
5501 | else | 5504 | else |
5502 | { | 5505 | { |
@@ -5508,7 +5511,7 @@ close_all_connections (struct MHD_Daemon *daemon) | |||
5508 | susp->urh->was_closed = MHD_YES; | 5511 | susp->urh->was_closed = MHD_YES; |
5509 | /* If thread-per-connection is used, connection's thread | 5512 | /* If thread-per-connection is used, connection's thread |
5510 | * may still processing "upgrade" (exiting). */ | 5513 | * may still processing "upgrade" (exiting). */ |
5511 | if (!used_thr_p_c) | 5514 | if (! used_thr_p_c) |
5512 | MHD_connection_finish_forward_ (susp); | 5515 | MHD_connection_finish_forward_ (susp); |
5513 | /* Do not use MHD_resume_connection() as mutex is | 5516 | /* Do not use MHD_resume_connection() as mutex is |
5514 | * already locked. */ | 5517 | * already locked. */ |
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h index 755515df..22187ae5 100644 --- a/src/microhttpd/internal.h +++ b/src/microhttpd/internal.h | |||
@@ -1015,34 +1015,38 @@ struct MHD_UpgradeResponseHandle | |||
1015 | /** | 1015 | /** |
1016 | * The buffer for receiving data from TLS to | 1016 | * The buffer for receiving data from TLS to |
1017 | * be passed to the application. Contains @e in_buffer_size | 1017 | * be passed to the application. Contains @e in_buffer_size |
1018 | * bytes. Do not free! | 1018 | * bytes (unless @e in_buffer_size is zero). Do not free! |
1019 | */ | 1019 | */ |
1020 | char *in_buffer; | 1020 | char *in_buffer; |
1021 | 1021 | ||
1022 | /** | 1022 | /** |
1023 | * The buffer for receiving data from the application to | 1023 | * The buffer for receiving data from the application to |
1024 | * be passed to TLS. Contains @e out_buffer_size | 1024 | * be passed to TLS. Contains @e out_buffer_size |
1025 | * bytes. Do not free! | 1025 | * bytes (unless @e out_buffer_size is zero). Do not free! |
1026 | */ | 1026 | */ |
1027 | char *out_buffer; | 1027 | char *out_buffer; |
1028 | 1028 | ||
1029 | /** | 1029 | /** |
1030 | * Size of the @e in_buffer | 1030 | * Size of the @e in_buffer. 0 if the connection went down for reading. |
1031 | */ | 1031 | */ |
1032 | size_t in_buffer_size; | 1032 | size_t in_buffer_size; |
1033 | 1033 | ||
1034 | /** | 1034 | /** |
1035 | * Size of the @e out_buffer | 1035 | * Size of the @e out_buffer. 0 if the connection went down for writing. |
1036 | */ | 1036 | */ |
1037 | size_t out_buffer_size; | 1037 | size_t out_buffer_size; |
1038 | 1038 | ||
1039 | /** | 1039 | /** |
1040 | * Number of bytes actually in use in the @e in_buffer | 1040 | * Number of bytes actually in use in the @e in_buffer. Can be larger |
1041 | * than @e in_buffer_size if and only if @a in_buffer_size is zero and | ||
1042 | * we still have bytes to process in the buffer. | ||
1041 | */ | 1043 | */ |
1042 | size_t in_buffer_used; | 1044 | size_t in_buffer_used; |
1043 | 1045 | ||
1044 | /** | 1046 | /** |
1045 | * Number of bytes actually in use in the @e out_buffer | 1047 | * Number of bytes actually in use in the @e out_buffer. Can be larger |
1048 | * than @e out_buffer_size if and only if @a out_buffer_size is zero and | ||
1049 | * we still have bytes to process in the buffer. | ||
1046 | */ | 1050 | */ |
1047 | size_t out_buffer_used; | 1051 | size_t out_buffer_used; |
1048 | 1052 | ||