[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] branch master updated: avoid redundant NULL
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] branch master updated: avoid redundant NULL check, make MHD_cleanup_upgraded_connection_ static (only used from within daemon.c) and rename to cleanup_upgraded_connection |
Date: |
Fri, 10 Mar 2017 16:28:17 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository libmicrohttpd.
The following commit(s) were added to refs/heads/master by this push:
new 4deb335d avoid redundant NULL check, make
MHD_cleanup_upgraded_connection_ static (only used from within daemon.c) and
rename to cleanup_upgraded_connection
4deb335d is described below
commit 4deb335de8af6cc943ca7fc20a69167d8845cd9b
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Mar 10 16:29:58 2017 +0100
avoid redundant NULL check, make MHD_cleanup_upgraded_connection_ static
(only used from within daemon.c) and rename to cleanup_upgraded_connection
---
src/microhttpd/daemon.c | 14 +++++++-------
src/microhttpd/internal.h | 12 ------------
2 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
index 3499f211..9dd2f1cd 100644
--- a/src/microhttpd/daemon.c
+++ b/src/microhttpd/daemon.c
@@ -1121,11 +1121,13 @@ call_handlers (struct MHD_Connection *con,
*
* @param connection handle to the upgraded connection to clean
*/
-void
-MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection)
+static void
+cleanup_upgraded_connection (struct MHD_Connection *connection)
{
struct MHD_UpgradeResponseHandle *urh = connection->urh;
+ if (NULL == urh)
+ return;
#ifdef HTTPS_SUPPORT
/* Signal remote client the end of TLS connection by
* gracefully closing TLS session. */
@@ -1139,13 +1141,12 @@ MHD_cleanup_upgraded_connection_ (struct MHD_Connection
*connection)
if (MHD_INVALID_SOCKET != urh->app.socket)
MHD_socket_close_chk_ (urh->app.socket);
#endif /* HTTPS_SUPPORT */
-
connection->urh = NULL;
- if (NULL != urh)
- free (urh);
+ free (urh);
}
#endif /* UPGRADE_SUPPORT */
+
#if defined(HTTPS_SUPPORT) && defined(UPGRADE_SUPPORT)
/**
* Performs bi-directional forwarding on upgraded HTTPS connections
@@ -2982,8 +2983,7 @@ MHD_cleanup_connections (struct MHD_Daemon *daemon)
(! MHD_join_thread_ (pos->pid)) )
MHD_PANIC (_("Failed to join a thread\n"));
#ifdef UPGRADE_SUPPORT
- if (NULL != pos->urh)
- MHD_cleanup_upgraded_connection_ (pos);
+ cleanup_upgraded_connection (pos);
#endif /* UPGRADE_SUPPORT */
MHD_pool_destroy (pos->pool);
#ifdef HTTPS_SUPPORT
diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h
index 4979474b..efe3fbb8 100644
--- a/src/microhttpd/internal.h
+++ b/src/microhttpd/internal.h
@@ -1800,16 +1800,4 @@ MHD_parse_arguments_ (struct MHD_Connection *connection,
unsigned int *num_headers);
-#ifdef UPGRADE_SUPPORT
-/**
- * Finally cleanup upgrade-related resources. It should
- * be called when TLS buffers have been drained and
- * application signaled MHD by #MHD_UPGRADE_ACTION_CLOSE.
- *
- * @param connection handle to the upgraded connection to clean
- */
-void
-MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection);
-#endif /* UPGRADE_SUPPORT */
-
#endif
--
To stop receiving notification emails like this one, please contact
address@hidden
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [libmicrohttpd] branch master updated: avoid redundant NULL check, make MHD_cleanup_upgraded_connection_ static (only used from within daemon.c) and rename to cleanup_upgraded_connection,
gnunet <=