1 typedef struct nchan_longpoll_multimsg_s nchan_longpoll_multimsg_t; 2 struct nchan_longpoll_multimsg_s { 3 nchan_msg_t *msg; 4 nchan_longpoll_multimsg_t *next; 5 }; 6 7 typedef struct { 8 ngx_http_cleanup_t *cln; 9 subscriber_callback_pt enqueue_callback; 10 void *enqueue_callback_data; 11 subscriber_callback_pt dequeue_callback; 12 void *dequeue_callback_data; 13 ngx_event_t timeout_ev; 14 ngx_event_t ping_ev; 15 16 nchan_longpoll_multimsg_t *multimsg_first; 17 nchan_longpoll_multimsg_t *multimsg_last; 18 19 unsigned act_as_intervalpoll:1; 20 unsigned holding:1; 21 unsigned finalize_request:1; 22 unsigned already_responded:1; 23 unsigned awaiting_destruction:1; 24 unsigned shook_hands:1; 25 } subscriber_data_t; 26 27 typedef struct { 28 subscriber_t sub; 29 subscriber_data_t data; 30 void *privdata; 31 } full_subscriber_t; 32 33 ngx_int_t longpoll_enqueue(subscriber_t *self); 34 ngx_int_t longpoll_dequeue(subscriber_t *self); 35 36 void subscriber_maybe_dequeue_after_status_response(full_subscriber_t *fsub, ngx_int_t status_code); 37 38 ngx_int_t subscriber_respond_unqueued_status(full_subscriber_t *fsub, ngx_int_t status_code, const ngx_str_t *status_line, ngx_chain_t *status_body); 39