static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy)
{
- timer_event_t *te;
apr_status_t rc;
proc_info *ti = dummy;
int process_slot = ti->pid;
apr_pool_t *tpool = apr_thread_pool_get(thd);
- void *csd = NULL;
- apr_pool_t *ptrans; /* Pool for per-transaction stuff */
- ap_listen_rec *lr;
- int have_idle_worker = 0;
- event_conn_state_t *cs;
- const apr_pollfd_t *out_pfd;
- apr_int32_t num = 0;
- apr_interval_time_t timeout_interval;
- apr_time_t timeout_time = 0, now, last_log;
- listener_poll_type *pt;
+ apr_time_t timeout_time = 0, last_log;
int closed = 0, listeners_disabled = 0;
last_log = apr_time_now();
apr_signal(LISTENER_SIGNAL, dummy_signal_handler);
for (;;) {
+ timer_event_t *te;
+ const apr_pollfd_t *out_pfd;
+ apr_int32_t num = 0;
+ apr_interval_time_t timeout_interval;
+ apr_time_t now;
int workers_were_busy = 0;
+ int have_idle_worker = 0;
if (listener_may_exit) {
close_listeners(process_slot, &closed);
if (terminate_mode == ST_UNGRACEFUL
}
while (num) {
- pt = (listener_poll_type *) out_pfd->client_data;
+ listener_poll_type *pt = (listener_poll_type *) out_pfd->client_data;
if (pt->type == PT_CSD) {
/* one of the sockets is readable */
struct timeout_queue *remove_from_q = &write_completion_q;
int blocking = 1;
- cs = (event_conn_state_t *) pt->baton;
+ event_conn_state_t *cs = (event_conn_state_t *) pt->baton;
switch (cs->pub.state) {
case CONN_STATE_CHECK_REQUEST_LINE_READABLE:
cs->pub.state = CONN_STATE_READ_REQUEST_LINE;
enable_listensocks(process_slot);
}
if (!listeners_disabled) {
- lr = (ap_listen_rec *) pt->baton;
+ void *csd = NULL;
+ ap_listen_rec *lr = (ap_listen_rec *) pt->baton;
+ apr_pool_t *ptrans; /* Pool for per-transaction stuff */
ap_pop_pool(&ptrans, worker_queue_info);
if (ptrans == NULL) {
proc_info *ti = dummy;
int process_slot = ti->pid;
int thread_slot = ti->tid;
- apr_socket_t *csd = NULL;
- event_conn_state_t *cs;
- apr_pool_t *ptrans; /* Pool for per-transaction stuff */
apr_status_t rv;
int is_idle = 0;
- timer_event_t *te = NULL;
free(ti);
SERVER_STARTING, NULL);
while (!workers_may_exit) {
+ apr_socket_t *csd = NULL;
+ event_conn_state_t *cs;
+ timer_event_t *te = NULL;
+ apr_pool_t *ptrans; /* Pool for per-transaction stuff */
+
if (!is_idle) {
rv = ap_queue_info_set_idle(worker_queue_info, NULL);
if (rv != APR_SUCCESS) {
break;
}
- te = NULL;
rv = ap_queue_pop_something(worker_queue, &csd, &cs, &ptrans, &te);
if (rv != APR_SUCCESS) {