gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] branch master updated (5cf4c61b -> 2a412f88)


From: gnunet
Subject: [libmicrohttpd] branch master updated (5cf4c61b -> 2a412f88)
Date: Sun, 21 Nov 2021 13:44:27 +0100

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a change to branch master
in repository libmicrohttpd.

    from 5cf4c61b microhttpd.h: doxy comments fixes
     new 0b9d6e94 Examples: fixed blocking sockets on W32
     new 3b950aef tests: fixed blocking sockets on W32
     new 87ab1ec7 test and examples: check socket control functions results
     new eac16d15 Tests: code style fixes
     new 2a412f88 tests and examples: fixed copy-paste errors in doxy

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 doc/examples/websocket.c                    |  9 +++++----
 src/examples/upgrade_example.c              |  9 ++++-----
 src/examples/websocket_chatserver_example.c |  6 +++---
 src/examples/websocket_threaded_example.c   |  7 ++++---
 src/microhttpd/test_upgrade.c               | 14 +++++++-------
 src/microhttpd/test_upgrade_large.c         | 14 +++++++-------
 6 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/doc/examples/websocket.c b/doc/examples/websocket.c
index fad1e95f..4fa6f4ed 100644
--- a/doc/examples/websocket.c
+++ b/doc/examples/websocket.c
@@ -286,15 +286,16 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
-#else
+#else  /* _WIN32 */
   unsigned long flags = 0;
 
-  ioctlsocket (fd, FIONBIO, &flags);
-#endif
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
+#endif /* _WIN32 */
 }
 
 
diff --git a/src/examples/upgrade_example.c b/src/examples/upgrade_example.c
index b0cc869d..08c718d0 100644
--- a/src/examples/upgrade_example.c
+++ b/src/examples/upgrade_example.c
@@ -40,7 +40,6 @@
  * Change socket to blocking.
  *
  * @param fd the socket to manipulate
- * @return non-zero if succeeded, zero otherwise
  */
 static void
 make_blocking (MHD_socket fd)
@@ -50,16 +49,16 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
 #elif defined(MHD_WINSOCK_SOCKETS)
-  unsigned long flags = 1;
+  unsigned long flags = 0;
 
-  ioctlsocket (fd, (int) FIONBIO, &flags);
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
 #endif /* MHD_WINSOCK_SOCKETS */
-
 }
 
 
diff --git a/src/examples/websocket_chatserver_example.c 
b/src/examples/websocket_chatserver_example.c
index eb5dad39..70ad6cae 100644
--- a/src/examples/websocket_chatserver_example.c
+++ b/src/examples/websocket_chatserver_example.c
@@ -707,16 +707,16 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
 #elif defined(MHD_WINSOCK_SOCKETS)
   unsigned long flags = 0;
 
-  ioctlsocket (fd, FIONBIO, &flags);
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
 #endif /* MHD_WINSOCK_SOCKETS */
-
 }
 
 
diff --git a/src/examples/websocket_threaded_example.c 
b/src/examples/websocket_threaded_example.c
index 1a2e2877..3a232b41 100644
--- a/src/examples/websocket_threaded_example.c
+++ b/src/examples/websocket_threaded_example.c
@@ -519,14 +519,15 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
 #elif defined(MHD_WINSOCK_SOCKETS)
-  unsigned long flags = 1;
+  unsigned long flags = 0;
 
-  ioctlsocket (fd, (int) FIONBIO, &flags);
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
 #endif /* MHD_WINSOCK_SOCKETS */
 }
 
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index b41a5561..111c6a79 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -456,7 +456,7 @@ notify_completed_cb (void *cls,
                      void **con_cls,
                      enum MHD_RequestTerminationCode toe)
 {
-  pthread_t*ppth = *con_cls;
+  pthread_t *ppth = *con_cls;
 
   (void) cls;
   (void) connection;  /* Unused. Silent compiler warning. */
@@ -464,7 +464,7 @@ notify_completed_cb (void *cls,
        (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
        (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
     abort ();
-  if (! pthread_equal (**((pthread_t**) con_cls),
+  if (! pthread_equal (**((pthread_t **) con_cls),
                        pthread_self ()))
     abort ();
   if (NULL != ppth)
@@ -554,7 +554,6 @@ notify_connection_cb (void *cls,
  * Change socket to blocking.
  *
  * @param fd the socket to manipulate
- * @return non-zero if succeeded, zero otherwise
  */
 static void
 make_blocking (MHD_socket fd)
@@ -564,14 +563,15 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
 #elif defined(MHD_WINSOCK_SOCKETS)
-  unsigned long flags = 1;
+  unsigned long flags = 0;
 
-  ioctlsocket (fd, (int) FIONBIO, &flags);
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
 #endif /* MHD_WINSOCK_SOCKETS */
 
 }
@@ -863,7 +863,7 @@ ahc_upgrade (void *cls,
 
   if (NULL == *con_cls)
     abort ();
-  if (! pthread_equal (**((pthread_t**) con_cls), pthread_self ()))
+  if (! pthread_equal (**((pthread_t **) con_cls), pthread_self ()))
     abort ();
   resp = MHD_create_response_for_upgrade (&upgrade_cb,
                                           NULL);
diff --git a/src/microhttpd/test_upgrade_large.c 
b/src/microhttpd/test_upgrade_large.c
index 4c54905d..3393a749 100644
--- a/src/microhttpd/test_upgrade_large.c
+++ b/src/microhttpd/test_upgrade_large.c
@@ -630,7 +630,7 @@ notify_completed_cb (void *cls,
                      void **con_cls,
                      enum MHD_RequestTerminationCode toe)
 {
-  pthread_t*ppth = *con_cls;
+  pthread_t *ppth = *con_cls;
 
   (void) cls;
   (void) connection;  /* Unused. Silent compiler warning. */
@@ -638,7 +638,7 @@ notify_completed_cb (void *cls,
        (toe != MHD_REQUEST_TERMINATED_CLIENT_ABORT) &&
        (toe != MHD_REQUEST_TERMINATED_DAEMON_SHUTDOWN) )
     abort ();
-  if (! pthread_equal (**((pthread_t**) con_cls),
+  if (! pthread_equal (**((pthread_t **) con_cls),
                        pthread_self ()))
     abort ();
   if (NULL != ppth)
@@ -728,7 +728,6 @@ notify_connection_cb (void *cls,
  * Change socket to blocking.
  *
  * @param fd the socket to manipulate
- * @return non-zero if succeeded, zero otherwise
  */
 static void
 make_blocking (MHD_socket fd)
@@ -738,14 +737,15 @@ make_blocking (MHD_socket fd)
 
   flags = fcntl (fd, F_GETFL);
   if (-1 == flags)
-    return;
+    abort ();
   if ((flags & ~O_NONBLOCK) != flags)
     if (-1 == fcntl (fd, F_SETFL, flags & ~O_NONBLOCK))
       abort ();
 #elif defined(MHD_WINSOCK_SOCKETS)
-  unsigned long flags = 1;
+  unsigned long flags = 0;
 
-  ioctlsocket (fd, (int) FIONBIO, &flags);
+  if (0 != ioctlsocket (fd, (int) FIONBIO, &flags))
+    abort ();
 #endif /* MHD_WINSOCK_SOCKETS */
 }
 
@@ -1050,7 +1050,7 @@ ahc_upgrade (void *cls,
 
   if (NULL == *con_cls)
     abort ();
-  if (! pthread_equal (**((pthread_t**) con_cls), pthread_self ()))
+  if (! pthread_equal (**((pthread_t **) con_cls), pthread_self ()))
     abort ();
   resp = MHD_create_response_for_upgrade (&upgrade_cb,
                                           NULL);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]