Commit Graph

1216 Commits

Author SHA1 Message Date
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
Andrei Zeliankou
5452ee458d Tests: fixed websocket tests. 2019-11-13 18:11:24 +03:00
Andrei Zeliankou
45d75ee2cb Tests: added Python test with threading. 2019-11-13 16:51:12 +03:00
Valentin Bartenev
69ff7ce731 Python: releasing GIL while waiting for a request.
It unblocks other threads that can be forked by the application
to work in background.

This closes #336 issue on GitHub.
2019-11-13 16:45:37 +03:00
Andrey Zelenkov
defb14f165 Tests: added Ruby test with constants. 2019-11-13 15:53:56 +03:00
Max Romanov
bdd96bc9ed Ruby: fixing initialization sequence.
There was a change (ruby/ruby@6c70fed) in Ruby 2.6 that moved
RUBY_DESCRIPTION global constant definition out of Init_version().
Unit initialized Ruby incorrectly, so the constant was not defined.

This closes #330 issue on GitHub.
2019-11-13 15:53:49 +03:00
Max Romanov
f2610d2160 Fixing libunit 'off by 2' issue in library.
Name and value in each header are 0-terminated, so additional 2 bytes
should be allocated for them.  There were several attempts to add these
2 bytes to headers in language modules, but some modules weren't updated.
Also, adding these 2 bytes is specific to the implementation which may be
changed later, so extending this mechanics to modules may cause errors.
2019-11-11 18:04:17 +03:00
Andrey Zelenkov
ed3298a3c6 Tests: fixed operator in http.py. 2019-11-08 14:04:32 +03:00
Valentin Bartenev
cc82547782 Respecting AR environment variable to configure ar binary. 2019-11-07 19:53:25 +03:00
Hong Zhi Dao
5d42599e33 Process port refactoring.
- Introduced nxt_runtime_process_port_create().
- Moved nxt_process_use() into nxt_process.c from nxt_runtime.c.
- Renamed nxt_runtime_process_remove_pid() as nxt_runtime_process_remove().
- Some public functions transformed to static.

This closes #327 issue on GitHub.
2019-10-29 16:07:21 +03:00
Max Romanov
65b03a14a7 Allocating process init struct from runtime memory pool.
This avoids memory leak reports from the address sanitizer.
2019-10-29 15:33:45 +03:00
Tiago Natel
4a79e9631b Added clone syscall check for uid/gid mapping.
Now it's possible to pass -DNXT_HAVE_CLONE=0 for debugging.
2019-10-28 16:02:40 +00:00
Tiago Natel
0b02e74abc Releasing the memory of removed thread pools at exit. 2019-10-28 15:49:03 +00:00
Andrey Zelenkov
13b4538fc7 Tests: added test with invalid "working_directory" value. 2019-10-23 16:59:53 +03:00
Andrey Zelenkov
d58fe3db98 Tests: more URI normalization tests. 2019-10-23 16:59:53 +03:00
Andrey Zelenkov
38cfe4cf3d Tests: added USR1 signal test for unit.log. 2019-10-23 16:59:53 +03:00
Andrey Zelenkov
1033cfa3b0 Tests: more static tests. 2019-10-23 16:59:53 +03:00
Andrey Zelenkov
47436e9be5 Tests: improved handshake for websocket tests. 2019-10-23 16:26:06 +03:00
Andrey Zelenkov
f878b6eea5 Tests: style. 2019-10-23 16:05:52 +03:00
Andrey Zelenkov
f5b1ac0dc6 Tests: check initial configuration in test_access_log.py. 2019-10-23 16:05:44 +03:00
Andrey Zelenkov
31bbc755fd Tests: check initial configuration in test_routing.py. 2019-10-23 16:05:40 +03:00
Andrey Zelenkov
1bece759a3 Tests: added flush() in "errors_write" Python application. 2019-10-23 16:05:35 +03:00
Max Romanov
ad518ae6c4 Python: fixing Python 3.8 build with clang.
Python 3.8 has 'tp_print' field in PyTypeObject struct.  This field is
attributed as deprecated.  So, clang generates warning (which is turned to
error) as a result of initializing this field.  From the other hand, it is
impossible to omit this field in positional initialization.  The solution
is to use designated initializer.

Silencing usage message during configure python.

This is related to #331 issue on GitHub.
2019-10-23 14:04:29 +03:00
Tiago Natel
23b94fde83 Improved error logging when uid/gid map is not properly set.
When using "credential: true", the new namespace starts with a completely
empty uid and gid ranges.  Then, any setuid/setgid/setgroups calls using ids
not properly mapped with uidmap and gidmap fields return EINVAL, meaning
the id is not valid inside the new namespace.
2019-10-22 14:46:15 +00:00
Max Romanov
2dbfd7c35e Fixing process crash in case of module load error.
This is related to #330 issue on GitHub.
2019-10-22 16:14:02 +03:00
Max Romanov
8df4468014 Fixing idle connection close function.
There was a typo: nxt_queue_head() used instead of nxt_queue_first() in
connection iteration loop.  This prevents idle connection close on quit.

This closes #334 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2019-10-22 16:04:56 +03:00
Max Romanov
e54f5f3dc8 Python: fixing build for Python 3.8.
Thanks to tonyafanasyev.
This is related to #331 issue on GitHub.
2019-10-22 16:04:30 +03:00
Tiago Natel
0beb8ea5e1 Fixed passing false in namespace flags.
This patch closes #328 in github.
2019-10-11 10:00:06 +00: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
Valentin Bartenev
75453479f3 Configuration: added check for mandatory options of "action". 2019-10-09 15:26:59 +03:00
Andrey Zelenkov
486b202cc1 Tests: default port number used. 2019-10-08 00:28:40 +03:00
Andrey Zelenkov
faf4ad5478 Tests: increased subprocess timeout on Unit exit.
Also changed order of subprocess status checks.
_terminate_process() method removed.
2019-10-08 00:28:40 +03:00
Valentin Bartenev
1b4c96f265 Version bump. 2019-10-07 18:38:41 +03:00
Valentin Bartenev
59db9a3887 Added tag 1.12.0 for changeset b391df5f0102 2019-10-03 17:34:58 +03:00
Valentin Bartenev
946cbd1f10 Generated Dockerfiles for Unit 1.12.0. 2019-10-03 17:08:32 +03:00
Valentin Bartenev
b1cb78ef8e Added version 1.12.0 CHANGES. 2019-10-03 16:30:31 +03:00
Igor Sysoev
aa910b276e Ignoring EINTR error in kqueue. 2019-10-03 16:13:13 +03:00
Konstantin Pavlov
f5e86ad8fc Regenerated Dockerfiles. 2019-10-03 15:08:50 +03:00
Konstantin Pavlov
c6df631bcc Docker: added an entrypoint to make configuration easier.
Docker images now accept shell scripts, json files and certificate chain
bundles to provide configuration on a container start by placing them
into /docker-entrypoint.d/ directory.
2019-10-03 15:08:44 +03:00
Valentin Bartenev
73f096f796 Added response status code to error page body.
Also the error page markup is now valid according to HTML5 specification.
All optional tags were omitted.
2019-10-02 20:04:52 +03:00
Max Romanov
9b4e45cafc Fixed "make tests" build without preceding "make".
Currently almost all Unit object files depends on generated nxt_version.h.
This patch adds missing dependence and fixes running make with multiple
jobs.

This closes #318 issue on GitHub.
2019-10-02 19:11:10 +03:00
Max Romanov
2eb6f35ef5 Go: fixing header buffer size calculation.
Header names and values are stored 0-terminated for ease of use in different
languages, so magic number 2 should be added to each name-value pair size.
2019-10-01 19:53:18 +03:00
Valentin Bartenev
f8ff71b917 HTTP: corrected allocation size for tail chunk. 2019-09-30 19:11:17 +03:00
Valentin Bartenev
f7d3db314d HTTP parser: removed unused "exten" field.
This field was intended for MIME type lookup by file extension when serving
static files, but this use case is too narrow; only a fraction of requests
targets static content, and the URI presumably isn't rewritten.  Moreover,
current implementation uses the entire filename for MIME type lookup if the
file has no extension.

Instead of extracting filenames and extensions when parsing requests, it's
easier to obtain them right before serving static content; this behavior is
already implemented.  Thus, we can drop excessive logic from parser.
2019-09-30 19:11:17 +03:00
Valentin Bartenev
2dbda125db HTTP parser: normalization of paths ending with "." or "..".
Earlier, the paths were normalized only if there was a "/" at the end, which
is wrong according to section 5.2.4 of RFC 3986 and hypothetically may allow
to the directory above the document root.
2019-09-30 19:11:17 +03:00