gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] 05/08: convert clean_ready to 'bool'


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] 05/08: convert clean_ready to 'bool'
Date: Wed, 15 Feb 2017 13:37:19 +0100

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

grothoff pushed a commit to branch master
in repository libmicrohttpd.

commit 925adb38895740003e6309d8170202fde1c337d1
Author: Christian Grothoff <address@hidden>
AuthorDate: Wed Feb 15 13:31:36 2017 +0100

    convert clean_ready to 'bool'
---
 src/microhttpd/daemon.c   | 16 ++++++++--------
 src/microhttpd/internal.h | 12 ++++++------
 src/microhttpd/response.c |  4 ++--
 3 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 2c976a8d..d7692394 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1753,7 +1753,7 @@ thread_main_handle_connection (void *data)
           /* MHD_connection_finish_forward_() was called by 
thread_main_connection_upgrade(). */
 
           /* "Upgraded" data will not be used in this thread from this point. 
*/
-          con->urh->clean_ready = MHD_YES;
+          con->urh->clean_ready = true;
           /* If 'urh->was_closed' set to true, connection will be
            * moved immediately to cleanup list. Otherwise connection
            * will stay in suspended list until 'urh' will be marked
@@ -2501,7 +2501,7 @@ resume_suspended_connections (struct MHD_Daemon *daemon)
 #ifdef UPGRADE_SUPPORT
           || ( (NULL != urh) &&
                ( (! urh->was_closed) ||
-                 (MHD_NO == urh->clean_ready) ) )
+                 (! urh->clean_ready) ) )
 #endif /* UPGRADE_SUPPORT */
          )
         continue;
@@ -3079,7 +3079,7 @@ MHD_run_from_select (struct MHD_Daemon *daemon,
            (0 == urh->out_buffer_used) )
         {
           MHD_connection_finish_forward_ (urh->connection);
-          urh->clean_ready = MHD_YES;
+          urh->clean_ready = true;
           /* Resuming will move connection to cleanup list. */
           MHD_resume_connection(urh->connection);
         }
@@ -3478,7 +3478,7 @@ MHD_poll_all (struct MHD_Daemon *daemon,
             /* MHD_connection_finish_forward_() will remove connection from
              * 'daemon->urh_head' list. */
             MHD_connection_finish_forward_ (urh->connection);
-            urh->clean_ready = MHD_YES;
+            urh->clean_ready = true;
             /* If 'urh->was_closed' set to true, connection will be
              * moved immediately to cleanup list. Otherwise connection
              * will stay in suspended list until 'urh' will be marked
@@ -3660,7 +3660,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
            * one time for TLS data and one time for socketpair data.
            * If forwarding was finished on first time, second time must
            * be skipped as urh must not be used anymore. */
-          if (MHD_NO != urh->clean_ready)
+          if (urh->clean_ready)
             continue;
 
           /* Update our state based on what is ready according to epoll() */
@@ -3677,7 +3677,7 @@ run_epoll_for_upgrade (struct MHD_Daemon *daemon)
                (0 == urh->out_buffer_used) )
             {
               MHD_connection_finish_forward_ (urh->connection);
-              urh->clean_ready = MHD_YES;
+              urh->clean_ready = true;
               /* If 'urh->was_closed' set to true, connection will be
                * moved immediately to cleanup list. Otherwise connection
                * will stay in suspended list until 'urh' will be marked
@@ -5606,7 +5606,7 @@ close_all_connections (struct MHD_Daemon *daemon)
          with chance to detect that application is done. */
       process_urh (urh);
       MHD_connection_finish_forward_ (urh->connection);
-      urh->clean_ready = MHD_YES;
+      urh->clean_ready = true;
       /* Resuming will move connection to cleanup list. */
       MHD_resume_connection(urh->connection);
     }
@@ -5637,7 +5637,7 @@ close_all_connections (struct MHD_Daemon *daemon)
 #ifdef HTTPS_SUPPORT
           else if (used_tls &&
                    used_thr_p_c &&
-                   (MHD_NO == susp->urh->clean_ready) )
+                   (! susp->urh->clean_ready) )
             shutdown (urh->app.socket,
                       SHUT_RDWR); /* Wake thread by shutdown of app socket. */
 #endif /* HTTPS_SUPPORT */
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 48da46d3..c47ed06d 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1098,27 +1098,27 @@ struct MHD_UpgradeResponseHandle
   volatile bool was_closed;
 
   /**
-   * Set to #MHD_YES if connection is ready for cleanup.
+   * Set to true if connection is ready for cleanup.
    *
    * In TLS mode functions #MHD_connection_finish_forward_() must
-   * be called before setting this flag to #MHD_YES.
+   * be called before setting this flag to true.
    *
-   * In thread-per-connection mode #MHD_YES in this flag means
+   * In thread-per-connection mode, true in this flag means
    * that connection's thread exited or about to exit and will
    * not use MHD_Connection::urh data anymore.
    *
-   * In any mode #MHD_YES in this flag also means that
+   * In any mode true in this flag also means that
    * MHD_Connection::urh data will not be used for socketpair
    * forwarding and forwarding itself is finished.
    *
    * When BOTH @e was_closed (changed by command from application)
    * AND @e clean_ready (changed internally by MHD) are set to
-   * #MHD_YES, function #MHD_resume_connection() will move this
+   * true, function #MHD_resume_connection() will move this
    * connection to cleanup list.
    * @remark This flag could be changed from thread that process
    * connection's recv(), send() and response.
    */
-  int clean_ready;
+  bool clean_ready;
 };
 #endif /* UPGRADE_SUPPORT */
 
diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c
index d9055416..7b1a8074 100644
--- a/src/microhttpd/response.c
+++ b/src/microhttpd/response.c
@@ -912,10 +912,10 @@ MHD_response_execute_upgrade_ (struct MHD_Response 
*response,
       urh->app.socket = MHD_INVALID_SOCKET;
       urh->mhd.socket = MHD_INVALID_SOCKET;
       /* Non-TLS connection do not hold any additional resources. */
-      urh->clean_ready = MHD_YES;
+      urh->clean_ready = true;
     }
 #else  /* ! HTTPS_SUPPORT */
-  urh->clean_ready = MHD_YES;
+  urh->clean_ready = true;
 #endif /* ! HTTPS_SUPPORT */
   connection->urh = urh;
   /* As far as MHD's event loops are concerned, this connection is

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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