Commit graph

1374 commits

Author SHA1 Message Date
Andrei Zeliankou
6e5b5d2a0b Tests: added tests for "return" action. 2020-03-27 15:50:09 +00:00
Andrei Zeliankou
5f2d07019c Tests: increase default "read_timeout" to 60s in message_read(). 2020-03-27 15:48:39 +00:00
Valentin Bartenev
c63b498f94 Implemented "location" option for "return" action.
This allows to specify redirects:

  {
      "action": {
          "return": 301,
          "location": "https://www.example.com/"
      }
  }
2020-03-21 01:39:00 +03:00
Valentin Bartenev
35d6f84426 Added nxt_is_complex_uri_encoded()/nxt_encode_complex_uri(). 2020-03-27 17:22:52 +03:00
Valentin Bartenev
d4b4cb0438 Updated URI escaping table for better conformity with RFC 3986.
Now '>', '<', '"', '^', '\', '}', '|', '{', and '`' are also escaped.
2020-03-27 17:22:52 +03:00
Valentin Bartenev
8d727774e3 Implemented "return" action.
The "return" action can be used to immediately generate a simple HTTP response
with an arbitrary status:

  {
      "action": {
          "return": 404
      }
  }

This is especially useful for denying access to specific resources.
2020-03-27 17:22:52 +03:00
Valentin Bartenev
5f9c4754cb Initialization of the action object made more consistent. 2020-03-27 17:22:52 +03:00
Andrei Zeliankou
8532cf6ae6 Tests: added tests for comments in JSON. 2020-03-25 19:40:08 +00:00
Andrei Zeliankou
2e4ad9fbc0 Tests: UTF-8 BOM test. 2020-03-25 19:31:42 +00:00
Valentin Bartenev
fd8e524b82 Configuration: fixed comments parsing.
Unclosed multi-line comments and "/" at the end of JSON shouldn't be allowed.
2020-03-25 19:14:15 +03:00
Andrei Zeliankou
48ad88ee72 Tests: increase default "read_timeout" value to 60s.
This change is necessary to avoid errors on slow hosts.

Also slightly reworked argument passing to the recvall() function.
2020-03-23 19:18:26 +00:00
Andrei Zeliankou
ac9ca6d75c Tests: added notification on unsuccessful connect(). 2020-03-23 19:12:22 +00:00
Andrei Zeliankou
b0161df42e Tests: wait for unit.pid file before running tests.
Waiting for control.unit.sock was replaced by unit.pid due to current problem
with race between connect() and listen() calls for control.unit.sock.

This change should be reverted after fix.
2020-03-23 19:09:29 +00:00
Konstantin Pavlov
bac93637ed Fixed filepath in the image checksum file. 2020-03-19 13:16:37 +03:00
Andrei Zeliankou
3fd4b4cfab Tests: rearranging functions in main.py. 2020-03-23 02:13:46 +00:00
Andrei Zeliankou
c7cc247baa Tests: terminate unitd process on exit(). 2020-03-23 02:12:44 +00:00
Max Romanov
59e06e4910 Completing buffers immediately
This fixes crash introduced in 039b00e32e3d.
2020-03-19 22:04:43 +03:00
Max Romanov
c26fbbe53a Completing request header buffers to avoid memory leak.
Before this fix, only persistent connection request buffers were completed.

This issue was introduced in dc403927ab0b.
2020-03-19 20:43:35 +03:00
Andrei Zeliankou
93207d4a8c Tests: test_python_procman.py refactored. 2020-03-19 03:17:00 +00:00
Andrei Zeliankou
06c790ac1e Tests: fixed prerequisite in test_share_fallback.py. 2020-03-19 03:15:50 +00:00
Max Romanov
c6f9ca79e6 Fixing body fd access racing condition.
To avoid closing the body fd prematurely, the fd value is moved from
the request struct to the app link.  The body fd should not be closed
immediately after the request is sent to the application due to possible
request rescheduling.
2020-03-17 14:44:11 +03:00
Max Romanov
efbcd517fc Checking sendfile() availability in configure.
Removing SF_NODISKIO flag for FreeBSD sendfile() check because it
is not used yet and to support DragonFlyBSD.

This closes #414 issue on GitHub.
2020-03-17 14:44:06 +03:00
Valentin Bartenev
b7f0e09de0 Version bump. 2020-03-16 13:27:10 +03:00
Konstantin Pavlov
3b94102f20 Added checksum generation to make dist target.
While at it, clean up dist artifacts on make clean.
2020-03-13 17:42:08 +03:00
Konstantin Pavlov
7181a661c5 Added a target to export docker images as tarballs 2020-03-13 17:35:47 +03:00
Andrei Zeliankou
baf9230398 Tests: skip "close failed" alert in test_proxy_parallel test. 2020-03-12 17:14:16 +00:00
Valentin Bartenev
b3c8a7b33a Added tag 1.16.0 for changeset 8bab088952dd 2020-03-12 18:35:33 +03:00
Valentin Bartenev
8f397c8ae5 Generated Dockerfiles for Unit 1.16.0. 2020-03-12 18:13:08 +03:00
Valentin Bartenev
f6d53f69b8 Added version 1.16.0 CHANGES. 2020-03-12 18:13:07 +03:00
Max Romanov
5296be0b82 Using disk file to store large request body.
This closes #386 on GitHub.
2020-03-12 17:54:29 +03:00
Max Romanov
08b65721e2 Moving request memory pool retain call after RPC data allocation.
If the call is done only after a successful RPC data allocation, its
corresponding release call is not missed, which avoids a potential leak.
2020-03-12 17:54:24 +03:00
Max Romanov
0b5aabfc3f Checking Content-Length value right after header parse.
The check was moved from the request body read stage.
2020-03-12 17:54:19 +03:00
Max Romanov
f3e6726098 Tests: added Python input readline and iterator tests. 2020-03-12 17:54:15 +03:00
Max Romanov
7c4db34b88 Python: implementing input readline and line iterator. 2020-03-12 17:54:11 +03:00
Max Romanov
2454dfe876 Introducing readline function in libunit.
Ruby and Java modules now use this function instead of own
implementations.
2020-03-12 17:54:05 +03:00
Andrei Zeliankou
23636ce02c Tests: fixed race in USR1 signal tests.
Also, minor style fixes applied.
2020-03-12 13:48:54 +00:00
Andrei Zeliankou
1d75277767 Tests: round robin upstream tests. 2020-03-12 13:47:43 +00:00
Andrei Zeliankou
961674af42 Tests: skip "last message send failed" alerts globally. 2020-03-12 13:44:30 +00: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
Andrei Zeliankou
b214b7c690 Tests: more routing tests with negative rules. 2020-01-31 18:12:16 +00:00
Axel Duch
f302ed0670 Fixed negative patterns combined with address rules. 2020-03-11 14:18:39 +00:00
Andrei Zeliankou
f092b093f5 Tests: use blocking to print unit.log files. 2020-03-10 18:13:47 +00:00
Andrei Zeliankou
f36f0f2461 Tests: redirect tests output to the stdout. 2020-03-10 18:10:42 +00:00
Valentin Bartenev
810b8dbb67 Tests: unitd stderr output redirected to unit.log.
A part of the debug log was printed to stderr before the log file was opened.
Now, this output is redirected to the same log file.
2020-03-06 20:08:38 +03:00
Valentin Bartenev
3617d4ed03 Tests: simplified unitd process running.
There are no reasons to wrap the Unit daemon in a separate Python process.
2020-03-06 20:08:29 +03:00
Tiago Natel de Moura
36578c7b43 PHP: fixed log format in alert.
Found by Coverity: CID 354832 and CID 354833.
2020-03-04 13:42:08 +00: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
Valentin Bartenev
afa2f86ecf PHP: added ZTS indication to ./configure output. 2020-03-04 15:24:27 +03:00