diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-11-30 16:20:33 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-12-01 15:05:56 +0300 |
commit | 280fb849e0fa6524520c1dc7aed78e695ec29e8e (patch) | |
tree | ac4ca66f3367dae9e9c294e6629f80e8686827ec | |
parent | 3f634541483e4d0aa2a0346233ebafc4c1500707 (diff) | |
download | libmicrohttpd-280fb849e0fa6524520c1dc7aed78e695ec29e8e.tar.gz libmicrohttpd-280fb849e0fa6524520c1dc7aed78e695ec29e8e.zip |
Minor readability improvements
-rw-r--r-- | src/examples/websocket_threaded_example.c | 6 | ||||
-rw-r--r-- | src/microhttpd/daemon.c | 2 | ||||
-rw-r--r-- | src/microhttpd/mhd_threads.h | 9 |
3 files changed, 8 insertions, 9 deletions
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c index 3a232b41..3f94cbd8 100644 --- a/src/examples/websocket_threaded_example.c +++ b/src/examples/websocket_threaded_example.c | |||
@@ -420,9 +420,9 @@ is_websocket_request (struct MHD_Connection *con, const char *upg_header, | |||
420 | 420 | ||
421 | (void) con; /* Unused. Silent compiler warning. */ | 421 | (void) con; /* Unused. Silent compiler warning. */ |
422 | 422 | ||
423 | return (upg_header != NULL) && (con_header != NULL) | 423 | return ((upg_header != NULL) && (con_header != NULL) |
424 | && (0 == strcmp (upg_header, WS_UPGRADE_VALUE)) | 424 | && (0 == strcmp (upg_header, WS_UPGRADE_VALUE)) |
425 | && (NULL != strstr (con_header, "Upgrade")) | 425 | && (NULL != strstr (con_header, "Upgrade"))) |
426 | ? MHD_YES | 426 | ? MHD_YES |
427 | : MHD_NO; | 427 | : MHD_NO; |
428 | } | 428 | } |
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 25ac0969..9731bf72 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -2157,7 +2157,7 @@ thread_main_handle_connection (void *data) | |||
2157 | #else | 2157 | #else |
2158 | 1, | 2158 | 1, |
2159 | #endif | 2159 | #endif |
2160 | (NULL == tvp) ? -1 : tv.tv_sec * 1000) < 0) | 2160 | (NULL == tvp) ? -1 : (tv.tv_sec * 1000)) < 0) |
2161 | { | 2161 | { |
2162 | if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_)) | 2162 | if (MHD_SCKT_LAST_ERR_IS_ (MHD_SCKT_EINTR_)) |
2163 | continue; | 2163 | continue; |
diff --git a/src/microhttpd/mhd_threads.h b/src/microhttpd/mhd_threads.h index 14612ded..818cd5fa 100644 --- a/src/microhttpd/mhd_threads.h +++ b/src/microhttpd/mhd_threads.h | |||
@@ -150,10 +150,9 @@ typedef struct _MHD_thread_handle_ID_ MHD_thread_handle_ID_; | |||
150 | * @param thread handle to watch | 150 | * @param thread handle to watch |
151 | * @return nonzero on success, zero otherwise | 151 | * @return nonzero on success, zero otherwise |
152 | */ | 152 | */ |
153 | #define MHD_join_thread_(thread) (WAIT_OBJECT_0 == WaitForSingleObject ( \ | 153 | #define MHD_join_thread_(thread) \ |
154 | (thread), INFINITE) ? (CloseHandle ( \ | 154 | ( (WAIT_OBJECT_0 == WaitForSingleObject ( (thread), INFINITE)) ? \ |
155 | (thread)), ! 0) : \ | 155 | (CloseHandle ( (thread)), ! 0) : 0 ) |
156 | 0) | ||
157 | #endif | 156 | #endif |
158 | 157 | ||
159 | #if defined(MHD_USE_POSIX_THREADS) | 158 | #if defined(MHD_USE_POSIX_THREADS) |
@@ -239,7 +238,7 @@ MHD_create_thread_ (MHD_thread_handle_ID_ *thread, | |||
239 | */ | 238 | */ |
240 | int | 239 | int |
241 | MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread, | 240 | MHD_create_named_thread_ (MHD_thread_handle_ID_ *thread, |
242 | const char*thread_name, | 241 | const char *thread_name, |
243 | size_t stack_size, | 242 | size_t stack_size, |
244 | MHD_THREAD_START_ROUTINE_ start_routine, | 243 | MHD_THREAD_START_ROUTINE_ start_routine, |
245 | void *arg); | 244 | void *arg); |