summaryrefslogtreecommitdiffhomepage
path: root/src (follow)
AgeCommit message (Collapse)AuthorFilesLines
2020-11-05Java: request processing in multiple threads.Max Romanov4-14/+205
This closes #458 issue on GitHub.
2020-11-05Python: fixing some arguments reference counting.Max Romanov1-33/+130
2020-11-05Python: request processing in multiple threads.Max Romanov13-497/+992
This closes #459 issue on GitHub.
2020-11-05Python: introducting macro to simplify minor version check.Max Romanov1-1/+3
2020-11-01Fixed building test app without debug.Valentin Bartenev1-2/+8
Compilers complained about unused variables after 37e2a3ea1bf1.
2020-10-30Java: supporting jsp-file attribute for servlet.Max Romanov1-0/+66
This closes #487 issue on GitHub.
2020-10-30Isolation: fixed passing custom options to nmount().Valentin Bartenev1-4/+8
The "iov" array was filled incorrectly when custom mounting options were set.
2020-10-29Isolation: mounting of procfs by default when using "rootfs".Tiago Natel de Moura6-108/+185
2020-10-29Isolation: correctly unmount non-dependent paths first.Tiago Natel de Moura1-4/+36
When mount points reside within other mount points, this patch sorts them by path length and then unmounts then in an order reverse to their mounting. This results in independent paths being unmounted first. This fixes an issue in buildbots where dependent paths failed to unmount, leading to the build script removing system-wide language libraries.
2020-10-28Added threading to the libunit test app.Max Romanov1-22/+108
2020-10-28Preserving the app port write socket.Max Romanov4-10/+17
The socket is required for intercontextual communication in multithreaded apps.
2020-10-28Libunit: waking another context with the RPC_READY message.Max Romanov1-1/+37
2020-10-28Router: introducing the PORT_ACK message.Max Romanov4-5/+39
The PORT_ACK message is the router's response to the application's NEW_PORT message. After receiving PORT_ACK, the application is safe to process requests using this port. This message avoids a racing condition when the application starts processing a request from the shared queue and sends REQ_HEADERS_ACK. The REQ_HEADERS_ACK message contains the application port ID as reply_port, which the router uses to send request data. When the application creates a new port, it immediately sends it to the main router thread. Because the request is processed outside the main thread, a racing condition can occur between the receipt of the new port in the main thread and the receipt of REQ_HEADERS_ACK in the worker router thread where the same port is specified as reply_port.
2020-10-28Libunit: releasing cached read buffers when destroying context.Max Romanov1-0/+8
2020-10-28Libunit: added a function to discern main and worker contexts.Max Romanov2-0/+13
2020-10-28Libunit: gracefully quitting a multicontext application.Max Romanov2-24/+74
2020-10-28Router: broadcasting the SHM_ACK message to all process ports.Max Romanov3-11/+40
2020-10-28Added error response logging.Max Romanov1-4/+10
Every internal server error response should have a clear description in log.
2020-10-28Router: checking a buffer before accessing its memory fields.Max Romanov1-1/+1
This fixes the router's crash on buildbot; the reason was an unexpected 'last' response from the application to the router arriving before the response headers. The last buffer is not a memory buffer, so the result of accessing memory fields is unpredictable. The unexpected 'last' message was caused by an error in libunit; fixed in fee8fd855a00.
2020-10-28Libunit: protecting the new mmap from being used in another thread.Max Romanov1-1/+6
Until the mmap is received by the router, only the creator thread may use this mmap, so the "mmap not found" state in the router is avoided.
2020-10-28Router: closing app worker's ports.Max Romanov1-0/+19
2020-10-26Increased request memory pool size.Valentin Bartenev1-1/+1
Previous value was too small, which reduced efficiency of the pool causing a lot of additional allocations even for simple request and response.
2020-10-14Fixing uninitialized ncpu value on unsupported platforms.Max Romanov1-1/+4
Thanks to @geyslan. This closes #455 issue on GitHub.
2020-10-14Java: response locale methods implemented.Max Romanov1-3/+18
This closes #479 issue on GitHub.
2020-10-13Using union instead of "void *".Igor Sysoev1-102/+110
2020-10-13Using C99 style declaration.Igor Sysoev1-563/+423
2020-10-13Reordering declarations.Igor Sysoev1-296/+317
2020-10-13Fixed building with Python 3.9.Valentin Bartenev2-2/+3
PyUnicode_GET_SIZE() in deprecated since 3.3 and will be removed in 3.12. In version 3.9 it was explicitly marked by deprecation warning causing compilation error with Unit. PyUnicode_GET_LENGTH() must be used instead.
2020-10-06PHP: compatibility with 8.0.0 RC1.Valentin Bartenev1-0/+30
This closes #474 PR on GitHub.
2020-10-07Router: fixed "not empty" pattern matching.Valentin Bartenev1-4/+0
The "!" pattern should be opposite to "", i.e. match only non-empty values. But after 3c00af54b937 it was equal to "!*", which is wrong.
2020-10-06Removing a meaningless warning message.Max Romanov1-4/+0
Data in the queue and the socket are transmitted independently; special READ_QUEUE and READ_SOCKET message types are used for synchronization. The warning was accidentally committed with changeset 1d84b9e4b459.
2020-10-02Fixed comment.Igor Sysoev1-1/+1
Thanks to 洪志道 (Hong Zhi Dao).
2020-10-01Python: ASGI server introduced.Max Romanov10-29/+3723
This closes #461 issue on GitHub.
2020-10-01Publishing libunit's malloc() and free() wrappers for apps.Max Romanov2-49/+57
2020-09-09PHP: fixed "rootfs" isolation dependency on system mounts.Tiago Natel de Moura1-55/+107
2020-09-30Fixing router connection pool leakage.Max Romanov1-1/+4
The connection's local socket address is allocated from the connection pool before the request is passed to the application; however, with keep-alive connections, this field was unconditionally reset by a socket configuration value that could be NULL. For the next request, the address was allocated again from the same connection pool. Nonetheless, all leaked addresses were released when the connection was closed. The issue introduced in changeset 5c7dd85fabd5.
2020-09-30Fixing leakage caused by incorrect in_hash flag cleanup.Max Romanov1-1/+3
Large-bodied requests are added to the request hash to be found when the body arrives. However, changeset 1d84b9e4b459 introduced a bug: the 'in_hash' flag, used to remove the request from the hash at request release, was cleared after the first successful request lookup. As a result, the entry was never removed.
2020-09-29MIME: added AVIF and APNG image formats.Valentin Bartenev1-1/+4
AVIF is a modern image format based on the AV1 video codec. It generally has better compression than other widely used formats (WebP, JPEG, PNG, and GIF) and is designed to supersede them. Support was already added to the latest version of Chrome. APNG extends PNG to permit animated images that work similarly to animated GIF. It's supported by most modern browsers. Also removed duplicated ".svg" entry.
2020-09-29Wrapping libunit's malloc() and free() calls for logging purposes.Max Romanov3-65/+98
This change aids heap usage analysis in applications. The alloc and free functions are also required for lvlhash due to the upcoming threading support, because using main nxt_memalign() and nxt_free() isn't safe in a multithreaded app environment. The reason is that these functions may use thread-local structures which aren't initialized properly in applications.
2020-09-29Fixing request buffer memory leakage in router.Max Romanov1-0/+3
The issue was introduced in changeset 1d84b9e4b459. The request buffer was transferred via the shared application queue, but the buffer position and the 'sent' flag were not updated after the buffer had been sent.
2020-09-29Supporting HTTP/1.0 keep-alive.Max Romanov1-1/+8
The Apache HTTP server benchmarking tool, ab, issues HTTP/1.0 requests with the 'Connection: Keep-Alive' header and expects a 'Connection: Keep-Alive' header in the response.
2020-09-18Updated racially charged language in messages and comments.Artem Konev2-4/+4
2020-09-18Python: app module callable name configuration.Max Romanov4-5/+21
Now it is possible to specify the name of the application callable using optional parameter 'callable'. Default value is 'application'. This closes #290 issue on GitHub.
2020-09-18Fixed segmentation fault during reconfiguration.Igor Sysoev1-7/+3
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-18Fixed segmentation fault during reconfiguration.Igor Sysoev1-1/+9
2020-09-18Fixed use-after-free error during reconfiguration.Igor Sysoev1-0/+2
An idle connection was not removed from idle connection list if the connections detected that listening socket had been closed.
2020-08-28Router: fixed "pass" to upstreams.hongzhidao3-3/+11
Messed up return values in nxt_upstream_find() caused error in applying any configuration with a valid "pass" value in router configuration pointing to upstream. That wasn't the case in "listeners" objects, where the return value wasn't checked. Also, it caused segfault in cases where the "pass" option was configured with variables and resulting value was pointing to a non-existent upstream. Added missing return checks as well to catch possible memory allocation errors. The bug was introduced in d32bc428f46b. This closes #472 issue on GitHub.
2020-09-16Isolation: remove redundant macro.Tiago Natel de Moura2-4/+1
2020-09-15Python: changed request headers format in router protocol.Max Romanov2-11/+107
The coming ASGI support requires raw HTTP headers format. Headers grouping and upcase code were moved to WSGI module.
2020-09-15Hardening header names comparation for grouping.Max Romanov1-10/+67