Commit Graph

1864 Commits

Author SHA1 Message Date
Andrei Zeliankou f68947bc60 Tests: truncated huge messages while logging. 2020-03-02 13:10:38 +00:00
Andrei Zeliankou 5d67879a50 Tests: added "-r" option to print unit.log on failures. 2020-02-27 18:41:24 +00:00
Andrei Zeliankou fbc72d7fec Tests: added test with invalid IPv6 address in routing block. 2020-02-27 01:37:54 +00:00
Tiago Natel de Moura 98c0ce6cc4 PHP: fixed php >= 7.4 with zts enabled. 2020-02-25 15:55:31 +00:00
Andrei Zeliankou f519e31e2d Tests: more static tests. 2020-02-21 15:08:38 +00:00
Andrei Zeliankou 5406d1e320 Tests: added PHP test with invalid index extension only. 2020-02-20 21:06:56 +00:00
Andrei Zeliankou 1f2445b01b Tests: added proxy test with large body. 2020-02-20 21:06:31 +00:00
Andrei Zeliankou fcca366392 Tests: more tests with "max_body_size". 2020-02-20 20:33:49 +00:00
Valentin Bartenev d198a105eb Configuration: removing UTF-8 BOM from the input JSON.
Some editors can add it to JSON files.
2020-02-20 17:58:24 +03:00
Valentin Bartenev 044b3afcda Configuration: stripping comments from the input JSON.
This allows to have JavaScript-like comments in the uploading JSON.
2020-02-20 17:58:24 +03:00
Valentin Bartenev 7a0383189c Version bump. 2020-02-19 19:13:51 +03:00
Valentin Bartenev 6e19090736 Added tag 1.15.0 for changeset 801ac82f80fb 2020-02-06 18:20:37 +03:00
Valentin Bartenev e6bb4c5493 Generated Dockerfiles for Unit 1.15.0. 2020-02-06 17:33:44 +03:00
Valentin Bartenev 672602d1ee Added version 1.15.0 CHANGES. 2020-02-06 17:33:44 +03:00
Tiago Natel de Moura 12e15ba43b Tests: added test for uploading files with SSL.
* * *
[mq]: multipart
2020-02-05 13:29:41 +00:00
Tiago Natel de Moura d3e218a8c3 Tests: add helper for form-data and multipart. 2020-02-05 13:13:04 +00:00
Tiago Natel de Moura 29d8b34244 Kept the value of c->socket.read_handler while data is available.
This closes #370 in GitHub.
2020-02-05 13:12:31 +00:00
Max Romanov 81b39d0b35 Tests: fixing Python 3.8.1 errors on Mac.
- "Can't pickle local object ..."
- "if __name__ == '__main__':" pattern required for multiprocessing
2020-02-04 11:39:34 +03:00
Max Romanov 7c38650cd1 Removing duplicate macro definitions.
This issue was introduced in 2c7f79bf0a1f.
2020-02-04 11:39:16 +03:00
Max Romanov 8eba2e5c3d Initializing local buffer ctx_impl field for correct release.
Uninitialized ctx_impl field may cause crash in application process.

To reproduce the issue, need to trigger shared memory buffer send error on
application side.  In our case, send error caused by router process crash.

This issue was introduced in 2c7f79bf0a1f.
2020-02-03 11:21:21 +03:00
Max Romanov 7ea9ebc55a Fixed req_app_link reference counting on cancellation.
Re-scheduled req_app_link structures should have use_count exactly equal
to the number of references from the application and port list.  However,
there's one extra usage decrement that occurs after the req_app_link is
created because the use_count is initialised as 1.

This patch removes all excess instances of the usage decrement that caused
preliminary req_app_link release and router process crash.

To reproduce the issue need to cause request rescheduling between 2 app
processes.

This issue was introduced in 61e9f23a566d.
2020-02-03 11:20:59 +03:00
Max Romanov 8c0f2cebf5 Storing pointer to next buffer in chain before free the buffer.
This is required to avoid dereference of freed memory.

Found by Coverity (CID 353372).
2020-02-03 11:14:14 +03:00
Max Romanov 51120e06e3 Added missing stream argument to error message.
Found by Coverity (CID 353386).
2020-02-03 11:14:06 +03:00
Max Romanov 224549a578 Freeing memory allocated for engine structure in case of error.
Found by Coverity (CID 353389).
2020-02-03 11:13:55 +03:00
Tiago Natel de Moura 117a4f11b9 Tests: check for php extension. 2020-01-23 11:57:15 +00:00
Valentin Bartenev f860c20a96 PHP: added check for the ".php" extension.
A check for the ".php" extension is added to prevent execution of files
with arbitrary extensions in cases where "index" and "script" options
aren't used.
2020-01-28 19:18:26 +03:00
Max Romanov 4024b18bcc Go: adding main configure CFLAGS and LDFLAGS to module build flags.
This makes ASAN buildbot workers to work out-of-the-box.
2020-01-28 19:20:46 +03:00
Axel Duch 4eb2d3086b Fixed missing IPv6 checking in route-addr and an unused variable.
This closes #363 issue on Github.
Thanks to to 洪志道 (Hong Zhi Dao).
2020-01-28 15:05:12 +00:00
Max Romanov 1451090d85 Node.js: suppress compilation warning. 2020-01-28 17:06:57 +03:00
Max Romanov 4e0a2002fe Java: fixing configure errors reporting. 2020-01-28 17:03:19 +03:00
Max Romanov 1949be644c Java: introducing SHA512 sum validation for external JARs. 2020-01-28 17:02:51 +03:00
Max Romanov 04bf6457c6 Java: fixing maven repository URL.
It is required to use https scheme and different host to download
packages from maven repository.
2020-01-28 17:01:21 +03:00
Max Romanov a58ca623cd Packages: added curl dependency to fetch Java archives. 2020-01-28 17:00:28 +03:00
Max Romanov 2f8b243fa4 Ruby: changing callback functions prototype for v2.7.
This closes #371 issue on GitHub.
2020-01-28 16:59:12 +03:00
Valentin Bartenev 4bad2cf1e9 Version bump. 2020-01-27 16:52:53 +03:00
Valentin Bartenev d2eac78c57 Updated copyright notice. 2020-01-27 16:52:45 +03:00
Valentin Bartenev 55f8e31ed7 Added tag 1.14.0 for changeset 6e28966ed1f2 2019-12-26 17:04:37 +03:00
Valentin Bartenev be8589d925 Generated Dockerfiles for Unit 1.14.0. 2019-12-26 17:03:21 +03:00
Valentin Bartenev 9403233328 Added version 1.14.0 CHANGES. 2019-12-26 17:03:21 +03:00
Max Romanov 693a458b4e Go: changing import name for "unit.nginx.org/go".
This patch includes packaging changes - update unit-go installation
directory.
2019-12-25 20:00:32 +03:00
Tiago Natel de Moura eced72ba25 Using the 64-bit Linux capability mode when available.
For backward compatibility, the Linux capabilities macros exposes v1 semantics
(32-bit) by default.  We probe the version at runtime (because of pre-compiled
binaries) but the kernel syscall API is conservative and it doesn't return a
64-bit capability version if the input version is v1.

This patch suppress the kernel > 5.0 dmesg log below:

  capability: warning: 'unitd' uses 32-bit capabilities (legacy support in use)
2019-12-16 17:12:09 +00:00
Axel Duch 96a9a790a0 Tests: routing by listener address. 2019-12-24 13:59:58 +00:00
Axel Duch 1a76371499 Router: introducing routing on listener address. 2019-12-24 13:59:58 +00:00
Axel Duch ee8fa5d467 Tests: routing by client address configuration. 2019-12-24 13:58:22 +00:00
Axel Duch 8677bf8d41 Router: introducing routing on client address. 2019-12-24 13:58:10 +00:00
Max Romanov 26ee4cb6c8 Go: introducing SHM_ACK observer.
Each request processed in a separate goroutine.  In case of OOSM state,
during response write, request goroutine blocks on channel which waits
event from main thread about SHM_ACK message from router.
2019-12-24 18:04:21 +03:00
Max Romanov 763bdff401 Node.js: implementing output message drain using SHM_ACK feature.
ServerResponse.write() method tries to write data buffer using libunit
and stores buffers to write in a Server-wide output queue, which is
processed in response to SHM_ACK message from router.

As a side effect 'drain' event implemented and socket.writable flag
reflect current state.
2019-12-24 18:04:17 +03:00
Max Romanov df7caf4650 Introducing port messages to notify about out of shared memory.
- OOSM (out of shared memory).  Sent by application process to router
  when application reaches the limit of allocated shared memory and
  needs more.
- SHM_ACK.  Sent by router to application when the application's shared
  memory is released and the OOSM flag is enabled for the segment.

This implements blocking mode (the library waits for SHM_ACK in case of
out of shared memory condition and retries allocating the required memory
amount) and non-blocking mode (the library notifies the application that
it's out of shared memory and returns control to the application module
that sets up the output queue and puts SHM_ACK in the main message loop).
2019-12-24 18:04:13 +03:00
Max Romanov 64f649f990 Adding "limits/shm" configuration validation and parsing. 2019-12-24 18:04:09 +03:00
Max Romanov 429c5a1c54 Renaming nxt_unit_mmap_buf_remove to nxt_unit_mmap_buf_unlink.
The function unchains the buffer from the buffer's linked list.
2019-12-24 18:04:05 +03:00