* Pre-condition: cs is neither in event_pollset nor a timeout queue * this function may only be called by the listener */
| 1369 | * this function may only be called by the listener |
| 1370 | */ |
| 1371 | static 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 |
no test coverage detected