MCPcopy Create free account
hub / github.com/apache/httpd / push2worker

Function push2worker

server/mpm/event/event.c:1371–1402  ·  view source on GitHub ↗

* Pre-condition: cs is neither in event_pollset nor a timeout queue * this function may only be called by the listener */

Source from the content-addressed store, hash-verified

1369 * this function may only be called by the listener
1370 */
1371static apr_status_t push2worker(event_conn_state_t *cs, apr_socket_t *csd,
1372 apr_pool_t *ptrans)
1373{
1374 apr_status_t rc;
1375
1376 if (cs) {
1377 csd = cs->pfd.desc.s;
1378 ptrans = cs->p;
1379 }
1380 rc = ap_queue_push_socket(worker_queue, csd, cs, ptrans);
1381 if (rc != APR_SUCCESS) {
1382 ap_log_error(APLOG_MARK, APLOG_CRIT, rc, ap_server_conf, APLOGNO(00471)
1383 "push2worker: ap_queue_push_socket failed");
1384 /* trash the connection; we couldn't queue the connected
1385 * socket to a worker
1386 */
1387 if (cs) {
1388 shutdown_connection(cs);
1389 }
1390 else {
1391 if (csd) {
1392 close_socket_nonblocking(csd);
1393 }
1394 if (ptrans) {
1395 ap_queue_info_push_pool(worker_queue_info, ptrans);
1396 }
1397 }
1398 signal_threads(ST_GRACEFUL);
1399 }
1400
1401 return rc;
1402}
1403
1404/* get_worker:
1405 * If *have_idle_worker_p == 0, reserve a worker thread, and set

Callers 1

listener_threadFunction · 0.85

Calls 5

ap_queue_push_socketFunction · 0.85
shutdown_connectionFunction · 0.85
ap_queue_info_push_poolFunction · 0.85
signal_threadsFunction · 0.70
ap_log_errorFunction · 0.50

Tested by

no test coverage detected