2
0
Evgeny Grin (Karlson2k) 5 жил өмнө
parent
commit
f53db2892e

+ 1 - 1
doc/examples/tlsauthentication.c

@@ -54,7 +54,7 @@ string_to_base64 (const char *message)
   }
 
   if (length % 3)
-    strncat (tmp, "===", 3 - length % 3);
+    strncat (tmp, "==", 3 - length % 3);
 
   return tmp;
 }

+ 3 - 3
src/examples/websocket_threaded_example.c

@@ -482,7 +482,7 @@ ws_get_accept_value (const char *key, char **val)
   char *str;
   ssize_t len;
 
-  if (NULL == key)
+  if ( (NULL == key) || (WS_KEY_LEN != strlen (key)))
   {
     return MHD_NO;
   }
@@ -535,7 +535,7 @@ send_all (MHD_socket sock, const unsigned char *buf, size_t len)
 
   for (off = 0; off < len; off += ret)
   {
-    ret = send (sock, (const void*)&buf[off], len - off, 0);
+    ret = send (sock, (const void*) &buf[off], len - off, 0);
     if (0 > ret)
     {
       if (EAGAIN == errno)
@@ -711,7 +711,7 @@ run_usock (void *cls)
     }
     if (type == WS_OPCODE_TEXT_FRAME)
     {
-      size = sprintf (client, "User#%d: ", (int)ws->sock);
+      size = sprintf (client, "User#%d: ", (int) ws->sock);
       size += got;
       text = malloc (size);
       if (NULL != text)