Commit Graph

9 Commits

Author SHA1 Message Date
Igor Sysoev
643c433f8e Using event engine memory buffers in HTTP/1 layer. 2019-11-14 16:39:48 +03:00
Igor Sysoev
834e8ca576 Fixed timer and event race condition.
When idle timeout occurs at the same time as a request comes in,
the timer handler closes connection while the read event triggers
request processing, and this eventually leads to segmentation fault.
2019-02-28 18:04:11 +03:00
Igor Sysoev
92ddc15a84 Checking error states in I/O handlers. 2018-11-13 19:04:48 +03:00
Valentin Bartenev
a4aaf90679 Re-engineered timers.
To optimize rbtree operations, all changes are stored in array and later
processed in batches.

The previous implementation of this mechanics had a number of design flaws.
Each change was saved in a new array entry; until the changes were applied,
the timer remained in an intermediate state (NXT_TIMER_CHANGING).
This intermediate state didn't allow to identify if time was going to be
disabled or enabled.  However, the nxt_conn_io_read() function relied on
this information; as a result, in some cases the read timeout wasn't set.

Also, the nxt_timer_delete() function did not reliably track whether a timer
was added to the work queue.  It checked the NXT_TIMER_ENQUEUED state of
a timer, but this state could be reset to NXT_TIMER_DISABLED by a
nxt_timer_disable() call or another nxt_timer_delete() call.

Now, instead of keeping the whole history of the timer's changes, the new
implementation updates the timer state immediately, and only one operation
is added to the array to add or delete timer in the rbtree according
to its final state.
2018-10-22 16:01:10 +03:00
Igor Sysoev
96cd68b340 Added SSL/TLS support on connection level. 2018-09-20 15:05:37 +03:00
Igor Sysoev
7458f66dda Fixed non-auto-reset timers. 2018-09-17 16:37:20 +03:00
Igor Sysoev
8654372842 Fixed segfault on listening socket close.
Now keep-alive connection sends 408 response if listening
socket was closed while reconfiguration.
2018-07-30 17:05:49 +03:00
Igor Sysoev
c7e575d5c6 Introducing connection state io_read_handler. 2018-04-11 17:33:18 +03:00
Igor Sysoev
7574c64992 nxt_event_conn_... functions and structures have been renamed
to nxt_conn_...
2017-06-14 15:18:52 +03:00