Igor Sysoev
90b2c9f7d6
Using union instead of "void *".
2020-10-13 12:56:56 +03:00
Igor Sysoev
f541cbcce4
Using C99 style declaration.
2020-10-13 12:56:56 +03:00
Igor Sysoev
edafa954d4
Reordering declarations.
2020-10-13 12:56:56 +03:00
Igor Sysoev
9d8d2c1758
Fixed comment.
...
Thanks to 洪志道 (Hong Zhi Dao).
2020-10-02 15:16:09 +03:00
Igor Sysoev
6b9882fc14
Fixed segmentation fault during reconfiguration.
...
If idle connection was closed before h1proto had been allocated
then c->socket.data is NULL. This happens if nxt_h1p_idle_response()
is called by nxt_h1p_idle_close(). However, h1p->conn_write_tail
is used only in nxt_h1p_request_send() that would not be called
after nxt_h1p_idle_response().
The bug was introduced in f237e8c553fd.
2020-09-18 13:20:06 +03:00
Igor Sysoev
6cfbf4ba79
Fixed segmentation fault during reconfiguration.
2020-09-18 13:20:05 +03:00
Igor Sysoev
09f4db1fc0
Fixed use-after-free error during reconfiguration.
...
An idle connection was not removed from idle connection list
if the connections detected that listening socket had been closed.
2020-09-18 13:20:02 +03:00
Igor Sysoev
22c88f0253
Upstream connection was not closed for short chunked response.
2020-09-07 15:21:14 +03:00
Igor Sysoev
18fbfc3d50
Destroying temporary router configuration.
...
The lifespan of a listening socket is longer than both router
configuration's and temporary router configuration's lifespan,
so the sockets should be stored in persistent queues. Safety
is ensured by the fact that the router processes only one new
configuration at any time.
2020-07-06 15:32:20 +03:00
Igor Sysoev
65799c7252
Upstream chunked transfer encoding support.
2020-06-23 14:16:45 +03:00
Igor Sysoev
f671d1bc54
Decreased level of some socket close() errors.
2020-06-23 14:16:43 +03:00
Igor Sysoev
ee62736a11
Fixed memory leak occurring upon failure to accept a connection.
2020-04-15 15:10:14 +03:00
Igor Sysoev
04143c8c7e
Fixed crash that occurs when idle connections are closed forcibly.
2020-04-15 14:54:09 +03:00
Igor Sysoev
e616d0915c
Disabled epoll error processing when socket events are inactive.
2020-04-15 14:54:09 +03:00
Igor Sysoev
01e957ef64
Rational number support in upstream server weight.
2020-03-30 19:47:01 +03:00
Igor Sysoev
7935ea4543
Round robin upstream added.
2020-03-06 18:28:54 +03:00
Igor Sysoev
794248090a
Legacy upstream code removed.
2020-03-04 14:04:08 +03:00
Igor Sysoev
643d4383fa
Refactored nxt_http_action.
2020-03-04 14:03:32 +03:00
Igor Sysoev
2d0dca5243
The kqueue EOF flag might be ignored on some conditions.
...
If kqueue reported both the EVFILT_READ and the EVFILT_WRITE events
for the socket but only the former had the EV_EOF flag set, the flag
was silently ignored.
2020-03-04 14:03:30 +03:00
Igor Sysoev
02e197e978
Processing inconsistent proxied response length.
...
Keepalive connection is disabled if upstream response length
differs from specified in the "Content-Length" field value.
2019-11-14 16:40:02 +03:00
Igor Sysoev
ddde9c23cf
Initial proxy support.
2019-11-14 16:39:54 +03:00
Igor Sysoev
57e326b411
Introduced chained buffer completion handlers.
2019-11-14 16:39:48 +03:00
Igor Sysoev
643c433f8e
Using event engine memory buffers in HTTP/1 layer.
2019-11-14 16:39:48 +03:00
Igor Sysoev
1ec6353733
Introduced event engine memory buffers.
2019-11-14 16:39:48 +03:00
Igor Sysoev
07c007af57
Event engine memory cache refactored.
2019-11-14 16:39:48 +03:00
Igor Sysoev
d4e3951c4d
Using request task.
2019-11-14 16:39:48 +03:00
Igor Sysoev
14e56fe8c8
Replacing pass with action.
2019-11-14 16:39:48 +03:00
Igor Sysoev
96cd6558ce
Fixed connect(2) errors processing on old Linuxes.
...
While connect(2) states that non-blocking connect should use EPOLLOUT:
EINPROGRESS
The socket is non-blocking and the connection cannot be completed
immediately. It is possible to select(2) or poll(2) for completion by
selecting the socket for writing. After select(2) indicates writability,
use getsockopt(2) to read the SO_ERROR option at level SOL_SOCKET to
determine whether connect() completed successfully (SO_ERROR is zero)
or unsuccessfully (SO_ERROR is one of the usual error codes listed here,
explaining the reason for the failure).
On connect error, Linux 2.6.32 (CentOS 6) may return EPOLLRDHUP, EPOLLERR,
EPOLLHUP, EPOLLIN, but not EPOLLOUT.
2019-11-14 16:39:48 +03:00
Igor Sysoev
09e7357b08
Style fixes.
2019-10-10 19:42:41 +03:00
Igor Sysoev
ec0d5c928e
Changed nxt_memcasecmp() interface to avoid casts.
2019-10-10 19:37:40 +03:00
Igor Sysoev
aa910b276e
Ignoring EINTR error in kqueue.
2019-10-03 16:13:13 +03:00
Igor Sysoev
2791c00cf2
Fixed error processing in SSL operations.
...
Before this fix EWOULDBLOCK error was fatal for SSL write operation.
This closes #325 issue on GitHub.
2019-09-30 17:17:31 +03:00
Igor Sysoev
e2abfaf381
Adding body handler to nxt_http_request_header_send().
2019-08-26 18:29:00 +03:00
Igor Sysoev
c7210eaa5a
nxt_h1proto_t definition was moved to h1proto implementation.
2019-08-06 15:29:40 +03:00
Igor Sysoev
17bb22a4e4
Refactored HTTP protocol callback table.
2019-08-06 15:29:39 +03:00
Igor Sysoev
a2c1907fda
Decreased level of some shutdown() and send() errors.
2019-06-18 18:01:03 +03:00
Igor Sysoev
1f8c395fc0
Cookie-based routing should be case-sensitive.
2019-06-10 18:47:35 +03:00
Igor Sysoev
6a775f58af
Added routing based on cookies.
2019-05-30 15:33:51 +03:00
Igor Sysoev
5fb3daa5af
Added routing based on arguments.
2019-05-30 15:33:51 +03:00
Igor Sysoev
16273cf1c6
Handling routing errors.
2019-05-30 15:33:51 +03:00
Igor Sysoev
0ba7cfce75
Added routing based on header fields.
2019-05-30 15:33:51 +03:00
Igor Sysoev
3aaebe4169
Fixed segfault with empty routes array.
2019-05-30 15:33:51 +03:00
Igor Sysoev
f2aa190f60
Fixed segfault with empty rule array.
2019-05-30 15:33:51 +03:00
Igor Sysoev
8339b15158
Added support for wildcards in the middle of match patterns.
2019-04-10 13:47:34 +03:00
Igor Sysoev
86d4a0e473
Fixed TLS connections hanging.
...
After event is delivered from the kernel its further processing is blocked.
Non-ready TSL I/O operation should mark connection I/O state as not ready
to unblock events and to allow their further processing. Otherwise
the connection hangs.
2019-03-01 18:20:05 +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
d4ccaae900
Initial routing implementation.
2019-02-27 16:41:11 +03:00
Igor Sysoev
95c9bba33b
Introduced nxt_memcpy_upcase().
2019-02-26 19:48:44 +03:00
Igor Sysoev
ce650ea0f7
Introduced nxt_conf_array_qsort().
2019-02-26 19:48:41 +03:00
Igor Sysoev
547082171e
Introduced nxt_conf_array_elements_count().
2019-02-26 19:48:38 +03:00
Igor Sysoev
444b9ffea9
Keepalive mode is disabled on HTTP header parsing errors.
2019-02-26 19:12:16 +03:00
Igor Sysoev
c96b2baca5
TLS certificates should be freed per listener.
...
This fixes memory leak if configuration uses more than one TLS cerificate.
2019-02-22 17:32:38 +03:00
Igor Sysoev
acb5b0aad7
Ignoring HUP signal in main process.
2019-02-18 18:34:20 +03:00
Igor Sysoev
bb11e9036f
Fixed memory leak on response body sending failure.
2019-02-18 17:28:55 +03:00
Igor Sysoev
fd6a6a5514
Fixed processing Unix listening socket failures.
...
This is related to issue #198 on GitHub.
2019-01-21 18:39:19 +03:00
Igor Sysoev
627b116c4d
Testing correct value.
2019-01-18 16:18:36 +03:00
Igor Sysoev
23a6a8e451
Testing correct value.
2019-01-18 16:18:36 +03:00
Igor Sysoev
92ddc15a84
Checking error states in I/O handlers.
2018-11-13 19:04:48 +03:00
Igor Sysoev
d4a99aad84
Backout of ba94959b1dec and improving epoll error handling.
2018-10-23 16:31:42 +03:00
Igor Sysoev
57991dc3f2
Fixed termination signal handlers in worker processes.
...
This closes #99 issue on GitHub.
Thanks to Julian Brost.
2018-10-22 17:43:31 +03:00
Igor Sysoev
50dd54877d
Improved epoll failures handling.
...
epoll changes are committed to the kernel before epoll_wait() or
on changes array overflow. In the latter case if there are errors
epoll_wait() timeout was not set to zero.
This commit is related to #173 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-22 17:43:28 +03:00
Igor Sysoev
deeb276d23
Removed duplicate code in epoll.
...
This commit is related to #173 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-22 16:25:58 +03:00
Igor Sysoev
b5d4fc939e
Disabled chunked transfer encoding for 204 responses.
2018-09-28 17:32:02 +03:00
Igor Sysoev
92da8dae1e
Fixed bug in socket write error handling.
...
The bug has been introduced in e3972a4a9c73.
2018-09-28 15:12:47 +03:00
Igor Sysoev
b5d76454ed
Added nginx error 497 response.
2018-09-20 15:05:38 +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
4bb4525031
Removed deprecated MacOSX OSSpinLockLock().
2018-09-17 16:37:17 +03:00
Igor Sysoev
74b69f5e95
Fixed typo.
...
This closes #166 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-09-17 16:37:13 +03:00
Igor Sysoev
ab5b67b45d
Fixed typo.
...
This closes #165 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-09-17 16:37:11 +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
69a1169cae
Sending 408 response on idle connection timeout.
2018-07-30 17:05:48 +03:00
Igor Sysoev
12c890c1ca
Added OpenBSD 3.9 getthrid().
...
Prodded by David Carlier.
2018-07-27 16:57:45 +03:00
Igor Sysoev
7e41f9d108
Refactored thread ID functions.
...
nxt_thread_tid() was moved to src/nxt_thread.c
nxt_thread_get_tid() was moved to src/nxt_thread_id.h.
src/nxt_thread_id.c was removed.
2018-07-27 16:53:26 +03:00
Igor Sysoev
bd8eacf52d
Fixed socket write error handling.
2018-07-12 18:29:22 +03:00
Igor Sysoev
5de582f6db
Disabling keep-alive connection on errors.
2018-07-12 18:29:22 +03:00
Igor Sysoev
071412a9ae
Fixed bug in "send_timeout" handling.
2018-07-12 18:29:22 +03:00
Igor Sysoev
313da403a5
Removed -mmacosx-version-min option.
2018-06-28 18:31:27 +03:00
Igor Sysoev
50228b35b6
Removed usage of nxt_thread_context in loadable modules.
...
This change allows to use __thread class storage on MacOSX.
2018-06-28 18:31:13 +03:00
Igor Sysoev
51b37f0693
Using appropriate default modules and state directories.
2018-06-28 17:36:48 +03:00
Igor Sysoev
61df281464
Added check of "make install" ability.
...
This closes #136 issue on GitHub.
2018-06-28 17:36:42 +03:00
Igor Sysoev
606eda045b
Removed '\r' and '\n' artifact macros.
2018-06-25 16:56:45 +03:00
Igor Sysoev
3ad1acca12
Fixed exit status on start failure.
...
This and previous commit close #131 issue on GitHub.
2018-06-18 17:14:32 +03:00
Igor Sysoev
cb36b07686
Removing Unix control socket on start failure.
...
The bug had appeared in 5cc5002a788e when process type has been
converted to bitmask. This commit reverts the type back to a number.
This commit is related to #131 issue on GitHub.
2018-06-18 17:14:30 +03:00
Igor Sysoev
6273819080
Removed unused single process type.
2018-06-18 17:14:25 +03:00
Igor Sysoev
ff6ca2a82c
Fixed keep-alive hanging after reconfiguration.
2018-05-30 18:46:05 +03:00
Igor Sysoev
e54fb892a4
PHP: fixed building on MacOSX with --ld-opt= option.
2018-05-30 18:31:26 +03:00
Igor Sysoev
d3356f7ad2
Added version number to main process title.
2018-05-29 19:51:27 +03:00
Igor Sysoev
8ed36563d1
Fixed alerts about freeing non-freeable memory on connection close.
...
The nxt_conn_t object is allocated by nxt_zget() and should not be freed.
2018-04-20 19:46:36 +03:00
Igor Sysoev
b95d5b8882
Prevention of freeing non-freeable memory pool block.
2018-04-20 19:46:36 +03:00
Igor Sysoev
d5a96ff000
Miscellaneous changes.
2018-04-12 17:11:35 +03:00
Igor Sysoev
8afa51415e
Disabling timer when request header has been entirely read.
2018-04-12 17:11:34 +03:00
Igor Sysoev
8e9a950374
Fixed idle timeout, broken in b3e55c647741.
2018-04-12 17:11:33 +03:00
Igor Sysoev
c7e575d5c6
Introducing connection state io_read_handler.
2018-04-11 17:33:18 +03:00
Igor Sysoev
0be4f1f693
Keepalive processing optimization.
2018-04-11 17:33:16 +03:00
Igor Sysoev
1fab645246
Added "408 Request Timeout" error response.
2018-04-10 19:38:48 +03:00
Igor Sysoev
73bdb5ec09
Refactored HTTP header parsing.
2018-04-10 19:38:45 +03:00
Igor Sysoev
0a44ac371a
Splitting HTTP processing in more granulate connection states.
2018-04-10 19:30:45 +03:00
Igor Sysoev
fa04c05aa0
HTTP: using r->mem_pool retention counter for response buffers.
2018-04-03 16:28:26 +03:00
Igor Sysoev
5177b085b1
nxt_lvlhsh_each() refactoring and nxt_lvlhsh_each_init().
2018-03-29 16:35:42 +03:00