libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 71806e71a661a0132f2c6d1b6c74a7ee73bb67e3
parent 36d3808c1e7f9646e6a9ca1cad42a4297f12c5ee
Author: Christian Grothoff <christian@grothoff.org>
Date:   Mon, 17 Oct 2016 10:21:40 +0200

remove bogus NULL check (this function must never be called with a NULL argument), rename as it is not static

Diffstat:
Msrc/microhttpd/daemon.c | 16++++++++--------
Msrc/microhttpd/internal.h | 3++-
Msrc/microhttpd/response.c | 2+-
3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -916,16 +916,15 @@ call_handlers (struct MHD_Connection *con, * 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 -cleanup_upgraded_connection (struct MHD_Connection *connection) +MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection) { - struct MHD_Daemon *daemon; + struct MHD_Daemon *daemon = connection->daemon; struct MHD_UpgradeResponseHandle *urh; - if (NULL == connection) - return; - daemon = connection->daemon; + urh = connection->urh; if (NULL == urh) return; @@ -1267,7 +1266,7 @@ thread_main_connection_upgrade (struct MHD_Connection *con) MHD_semaphore_down (con->upgrade_sem); MHD_semaphore_destroy (con->upgrade_sem); con->upgrade_sem = NULL; - cleanup_upgraded_connection(con); + MHD_cleanup_upgraded_connection_ (con); } @@ -2785,8 +2784,9 @@ MHD_run_from_select (struct MHD_Daemon *daemon, /* call generic forwarding function for passing data */ process_urh (urh); /* cleanup connection if it was closed and all data was sent */ - if (MHD_YES == urh->was_closed && 0 == urh->out_buffer_off) - cleanup_upgraded_connection (urh->connection); + if ( (MHD_YES == urh->was_closed) && + (0 == urh->out_buffer_off) ) + MHD_cleanup_upgraded_connection_ (urh->connection); } #endif MHD_cleanup_connections (daemon); diff --git a/src/microhttpd/internal.h b/src/microhttpd/internal.h @@ -1727,9 +1727,10 @@ MHD_parse_arguments_ (struct MHD_Connection *connection, * 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 -cleanup_upgraded_connection (struct MHD_Connection *connection); +MHD_cleanup_upgraded_connection_ (struct MHD_Connection *connection); #endif diff --git a/src/microhttpd/response.c b/src/microhttpd/response.c @@ -660,7 +660,7 @@ MHD_upgrade_action (struct MHD_UpgradeResponseHandle *urh, } #endif /* 'upgraded' resources are not needed anymore - cleanup now */ - cleanup_upgraded_connection (connection); + MHD_cleanup_upgraded_connection_ (connection); return MHD_YES; default: /* we don't understand this one */