diff options
Diffstat (limited to 'src/examples/websocket_threaded_example.c')
-rw-r--r-- | src/examples/websocket_threaded_example.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/examples/websocket_threaded_example.c b/src/examples/websocket_threaded_example.c index 1f4db5b8..4c767f0a 100644 --- a/src/examples/websocket_threaded_example.c +++ b/src/examples/websocket_threaded_example.c | |||
@@ -482,7 +482,7 @@ ws_get_accept_value (const char *key, char **val) | |||
482 | char *str; | 482 | char *str; |
483 | ssize_t len; | 483 | ssize_t len; |
484 | 484 | ||
485 | if (NULL == key) | 485 | if ( (NULL == key) || (WS_KEY_LEN != strlen (key))) |
486 | { | 486 | { |
487 | return MHD_NO; | 487 | return MHD_NO; |
488 | } | 488 | } |
@@ -535,7 +535,7 @@ send_all (MHD_socket sock, const unsigned char *buf, size_t len) | |||
535 | 535 | ||
536 | for (off = 0; off < len; off += ret) | 536 | for (off = 0; off < len; off += ret) |
537 | { | 537 | { |
538 | ret = send (sock, (const void*)&buf[off], len - off, 0); | 538 | ret = send (sock, (const void*) &buf[off], len - off, 0); |
539 | if (0 > ret) | 539 | if (0 > ret) |
540 | { | 540 | { |
541 | if (EAGAIN == errno) | 541 | if (EAGAIN == errno) |
@@ -711,7 +711,7 @@ run_usock (void *cls) | |||
711 | } | 711 | } |
712 | if (type == WS_OPCODE_TEXT_FRAME) | 712 | if (type == WS_OPCODE_TEXT_FRAME) |
713 | { | 713 | { |
714 | size = sprintf (client, "User#%d: ", (int)ws->sock); | 714 | size = sprintf (client, "User#%d: ", (int) ws->sock); |
715 | size += got; | 715 | size += got; |
716 | text = malloc (size); | 716 | text = malloc (size); |
717 | if (NULL != text) | 717 | if (NULL != text) |