Mercurial > hg > nginx
comparison src/event/ngx_event.c @ 7612:1ce3f01a4355
SSL: reworked posted next events.
Introduced in 9d2ad2fb4423 available bytes handling in SSL relied
on connection read handler being overwritten to set the ready flag
and the amount of available bytes. This approach is, however, does
not work properly when connection read handler is changed, for example,
when switching to a next pipelined request, and can result in unexpected
connection timeouts, see here:
http://mailman.nginx.org/pipermail/nginx-devel/2019-December/012825.html
Fix is to introduce ngx_event_process_posted_next() instead, which
will set ready and available regardless of how event handler is set.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 24 Dec 2019 17:24:59 +0300 |
parents | 9d2ad2fb4423 |
children | f1720934c45b |
comparison
equal
deleted
inserted
replaced
7611:8e64e11aaca0 | 7612:1ce3f01a4355 |
---|---|
236 } | 236 } |
237 } | 237 } |
238 } | 238 } |
239 | 239 |
240 if (!ngx_queue_empty(&ngx_posted_next_events)) { | 240 if (!ngx_queue_empty(&ngx_posted_next_events)) { |
241 ngx_queue_add(&ngx_posted_events, &ngx_posted_next_events); | |
242 ngx_queue_init(&ngx_posted_next_events); | |
243 timer = 0; | 241 timer = 0; |
244 } | 242 } |
245 | 243 |
246 delta = ngx_current_msec; | 244 delta = ngx_current_msec; |
247 | 245 |
261 if (delta) { | 259 if (delta) { |
262 ngx_event_expire_timers(); | 260 ngx_event_expire_timers(); |
263 } | 261 } |
264 | 262 |
265 ngx_event_process_posted(cycle, &ngx_posted_events); | 263 ngx_event_process_posted(cycle, &ngx_posted_events); |
264 ngx_event_process_posted_next(cycle, &ngx_posted_next_events); | |
266 } | 265 } |
267 | 266 |
268 | 267 |
269 ngx_int_t | 268 ngx_int_t |
270 ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags) | 269 ngx_handle_read_event(ngx_event_t *rev, ngx_uint_t flags) |