GNU libmicrohttpd 0.9.77
Loading...
Searching...
No Matches
request_resume.c File Reference

implementation of MHD_request_resume() More...

#include "internal.h"
#include "connection_close.h"
Include dependency graph for request_resume.c:

Go to the source code of this file.

Functions

void MHD_request_resume (struct MHD_Request *request)
 
bool MHD_resume_suspended_connections_ (struct MHD_Daemon *daemon)
 

Detailed Description

implementation of MHD_request_resume()

Author
Christian Grothoff

Definition in file request_resume.c.

Function Documentation

◆ MHD_request_resume()

void MHD_request_resume ( struct MHD_Request request)

Resume handling of network data for suspended request. It is safe to resume a suspended request at any time. Calling this function on a request that was not previously suspended will result in undefined behavior.

If you are using this function in `‘external’' select mode, you must make sure to run MHD_run() afterwards (before again calling MHD_get_fdset(), as otherwise the change may not be reflected in the set returned by MHD_get_fdset() and you may end up with a request that is stuck until the next network activity.

Parameters
requestthe request to resume

Definition at line 43 of file request_resume.c.

References _, MHD_Daemon::cleanup_connection_mutex, MHD_Request::connection, MHD_Request::daemon, MHD_Daemon::disallow_suspend_resume, MHD_Daemon::itc, MHD_mutex_lock_chk_, MHD_mutex_unlock_chk_, MHD_PANIC, MHD_Connection::resuming, and MHD_Daemon::resuming.

Referenced by internal_run_from_select(), MHD_daemon_close_all_connections_(), and thread_main_handle_connection().

Here is the caller graph for this function:

◆ MHD_resume_suspended_connections_()

bool MHD_resume_suspended_connections_ ( struct MHD_Daemon daemon)

Run through the suspended connections and move any that are no longer suspended back to the active state.

Remarks
To be called only from thread that process daemon's select()/poll()/etc.
Parameters
daemondaemon context
Returns
true if a connection was actually resumed

Definition at line 79 of file request_resume.c.

References _, MHD_Daemon::cleanup_connection_mutex, MHD_Daemon::cleanup_head, MHD_Daemon::cleanup_tail, MHD_Request::client_context, MHD_Daemon::connection_default_timeout, MHD_Connection::connection_timeout, MHD_Daemon::connections_head, MHD_Daemon::connections_tail, MHD_Connection::daemon, DLL_insert, DLL_remove, EDLL_insert, MHD_Daemon::event_loop_syscall, MHD_Daemon::itc, MHD_Connection::last_activity, MHD_Daemon::manual_timeout_head, MHD_Daemon::manual_timeout_tail, mhd_assert, MHD_EPOLL_STATE_IN_EREADY_EDLL, MHD_EPOLL_STATE_READ_READY, MHD_EPOLL_STATE_WRITE_READY, MHD_monotonic_sec_counter(), MHD_mutex_lock_chk_, MHD_mutex_unlock_chk_, MHD_PANIC, MHD_REQUEST_TERMINATED_COMPLETED_OK, MHD_Daemon::normal_timeout_head, MHD_Daemon::normal_timeout_tail, NULL, MHD_Connection::prev, MHD_Connection::request, MHD_Request::response, MHD_Connection::resuming, MHD_Daemon::resuming, MHD_Daemon::shutdown, MHD_Connection::suspended, MHD_Daemon::suspended_connections_head, MHD_Daemon::suspended_connections_tail, MHD_Response::termination_cb, MHD_Response::termination_cb_cls, MHD_Daemon::threading_mode, MHD_Daemon::worker_pool, and XDLL_insert.

Referenced by MHD_daemon_close_all_connections_(), MHD_daemon_run_from_select(), MHD_daemon_select_(), and MHD_polling_thread().

Here is the call graph for this function:
Here is the caller graph for this function: