Commit Graph
100 Commits
Author SHA1 Message Date
Valentin Bartenev aeb026c8ab Node.js: removed unused dependency. 2018-12-12 19:57:15 +03:00
Valentin Bartenev f51f95fa54 Node.js: fixed global install in some cases.
By default "npm install" switches to non-privileged user to run package scripts
if it is invoked by root.  As a result it may prevent node-gyp from writing to
package directory and break installation of the module.

To disable this switching the --unsafe-perm flag is added.
2018-12-12 19:54:52 +03:00
Valentin Bartenev d500e29f88 Ruby: rpath made optional.
In most cases it is not needed because Ruby libraries are in the default path.
At the same time, rpath pointing to the default path is prohibited by rpmbuild
on Fedora.

This is related to issue #87 on GitHub.
2018-12-04 17:18:00 +03:00
Valentin Bartenev db63191719 PHP: fixed "disable_functions" and "disable_classes" options.
It turned out they need additional processing to work.
This closes #183 issue on GitHub.
2018-11-27 22:06:39 +03:00
Valentin Bartenev 262578dc71 PHP: workaround for bug #71041.
Since PHP 7, a zend_signal_startup() call is required if the interpreter
was built with ZEND_SIGNALS defined; such a call was added in 3fd76e4ce70a.

However, the zend_signal_startup() export is missing from the PHP library;
as the result, dlopen() fails with the 'Undefined symbol "zend_signal_startup"'
error while loading the PHP module.

Meanwhile, if PHP is built without ZTS, the zend_signal_startup() call can
be omitted; otherwise, the missing call causes segmentation fault.

The PHP fix already was committed to upstream, but we still have to deal
with numerous unpatched versions remaining at large.

See the related PHP bug: https://bugs.php.net/bug.php?id=71041
2018-11-22 20:23:43 +03:00
Valentin Bartenev adf22b6a0d PHP: fixed compatibility with ZTS.
This closes #184 issue on GitHub.
2018-11-21 18:22:19 +03:00
Valentin Bartenev 39cd4a9dee Prettier ./configure summary. 2018-11-15 21:50:00 +03:00
Valentin Bartenev c1fd6cb589 Added TLS information to ./configure summary. 2018-11-15 20:08:46 +03:00
Valentin Bartenev e4d9cffedf Version bump. 2018-11-15 20:08:43 +03:00
Valentin Bartenev a4b02e1738 Added tag 1.6 for changeset d411e7fdee9e 2018-11-15 16:06:42 +03:00
Valentin Bartenev 1ebd23f11a Generated Dockerfiles for Unit 1.6. 2018-11-15 16:05:11 +03:00
Valentin Bartenev b4e2ec43d1 Added version 1.6 CHANGES. 2018-11-15 15:56:09 +03:00
Valentin Bartenev 2b4d83cbd8 Node.js: npm package readme cleanup. 2018-11-15 15:53:35 +03:00
Valentin Bartenev b033fb329f Fixed lvlhsh test on 64-bit big-endian systems.
The nxt_murmur_hash2() generated 4-byte hash that was stored in uintptr_t,
which was 8 bytes long on 64-bit systems.  At each iteration, it took the
previous key and hashed it again.

The problem was that it took only the first 4 bytes of the key, and these
4 bytes were always zero on 64-bit big-endian system.  That resulted in
equal keys at each iteration.

The bug was discovered on IBM/S390x.
2018-11-15 13:00:58 +03:00
Valentin Bartenev 08e0082e07 Fixed discovering of modules on 64-bit big-endian systems.
The nxt_conf_map_object() function used nxt_int_t for NXT_CONF_MAP_INT, which
was 8 bytes long on 64-bit systems.

But the nxt_port_main_start_worker_handler() used it to map into the int field
of the nxt_common_app_conf_t structure, which was 4 bytes.  As the result, on
a 64-bit big-endian system all the meaningful module type numbers were assigned
into the gap above the "type" field.

The bug was discovered on IBM/S390x.
2018-11-15 11:59:03 +03:00
Valentin Bartenev ed8bfc669f Node.js: reworked installation procedure.
Now by default "make install" installs the module globally.
The "--local" configure option added for local installation.
2018-11-14 20:12:47 +03:00
Valentin Bartenev 0b558b873a Node.js: ./configure script cleanup. 2018-11-14 20:01:34 +03:00
Valentin Bartenev ff9bed64da Fixed nxt_openssl_chain_file() return type.
This closes #182 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-11-13 18:43:39 +03:00
Valentin Bartenev 4f4a2d8c63 Fixed "freed pointer is out of pool" alerts.
The issue was caused by misplacement of allocated blocks in rbtree due
to broken comparison function if the distance between two allocations
did not fit into intptr_t.  As the result, nxt_mp_free() could have
failed to find the allocation.

In particular, it was mostly observed when Unit was compiled with
musl C library on 32-bits systems.

This closes #118 issue on GitHub.
2018-11-10 07:38:43 +03:00
Valentin Bartenev 3b0afb1681 Version bump. 2018-10-31 16:31:14 +03:00
Valentin Bartenev fd99a738e5 Added tag 1.5 for changeset b3dee0cc5a4e 2018-10-25 18:55:39 +03:00
Valentin Bartenev a1abebd5b9 Generated Dockerfiles for Unit 1.5. 2018-10-25 17:49:10 +03:00
Valentin Bartenev d55282105a Packages: updated to 1.5-1. 2018-10-25 17:49:10 +03:00
Valentin Bartenev a04554118c Added version 1.5 CHANGES. 2018-10-25 17:48:56 +03:00
Valentin Bartenev 6cc4080af2 Removed unused "--upstream" command line option. 2018-10-23 18:55:16 +03:00
Valentin Bartenev da0ef366dc Handling of timers with bias.
Timers that don't require maximum precision (most of them, actually) can be
triggered earlier or later within the bias interval.

To reduce wakeups by timers, the expire function now triggers not only all
timers that fall within the elapsed time, but also those whose bias falls
within this interval.
2018-10-22 16:04:16 +03:00
Valentin Bartenev b20e995e80 Timers: separation of delete and insert operations on rbtree.
Delete/insert operation complexity for a red-black tree is O(log n),
where n is the total number of tree elements.

If all delete operations are performed before all insert operations,
the average number of tree elements during an operation will be
lower than in the mixed-operations case.
2018-10-22 16:02:14 +03:00
Valentin Bartenev a4aaf90679 Re-engineered timers.
To optimize rbtree operations, all changes are stored in array and later
processed in batches.

The previous implementation of this mechanics had a number of design flaws.
Each change was saved in a new array entry; until the changes were applied,
the timer remained in an intermediate state (NXT_TIMER_CHANGING).
This intermediate state didn't allow to identify if time was going to be
disabled or enabled.  However, the nxt_conn_io_read() function relied on
this information; as a result, in some cases the read timeout wasn't set.

Also, the nxt_timer_delete() function did not reliably track whether a timer
was added to the work queue.  It checked the NXT_TIMER_ENQUEUED state of
a timer, but this state could be reset to NXT_TIMER_DISABLED by a
nxt_timer_disable() call or another nxt_timer_delete() call.

Now, instead of keeping the whole history of the timer's changes, the new
implementation updates the timer state immediately, and only one operation
is added to the array to add or delete timer in the rbtree according
to its final state.
2018-10-22 16:01:10 +03:00
Valentin Bartenev 029c1a9f50 Renamed "go" application type to "external".
There's nothing specific to Go language.  This type of application object can
be used to run any external application that utilizes libunit API.
2018-10-09 17:53:31 +03:00
Valentin Bartenev d54d806c52 Disabled chunked transfer encoding for 304 responses as well.
According to RFC 7232:

 | A 304 response cannot contain a message-body; it is always terminated
 | by the first empty line after the header fields.
2018-10-01 15:06:31 +03:00
Valentin Bartenev 3c2eddb183 Allowing keep-alive connections after 204 responses.
This was unintentionally disabled by 7b5026a0bdeb.
2018-10-01 15:06:31 +03:00
Valentin Bartenev e51ab1b2cb Fixed error log time caching resolution.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-01 15:06:31 +03:00
Valentin Bartenev db1e01d992 Mention of --openssl configure option in help.
This closes #171 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-10-01 15:06:31 +03:00
Valentin Bartenev 425d560372 Version bump. 2018-09-28 15:05:35 +03:00
Valentin Bartenev 6b8a992bfa Added tag 1.4 for changeset 8f4524a9cf87 2018-09-20 18:20:41 +03:00
Valentin Bartenev 80217caa52 Generated Dockerfiles for Unit 1.4. 2018-09-20 18:19:14 +03:00
Valentin Bartenev 63ff7a341a Added version 1.4 CHANGES. 2018-09-20 18:18:52 +03:00
Valentin Bartenev 510c2e15c5 Python: adjusted input.read(size) argument value interpretation.
Previously, passing 0 resulted in reading the whole body and all negative
values raised an exception.

Now the behaviour is in consistentance with io.RawIOBase.read() interface,
and passing 0 returns empty (byte) string, while -1 results in reading the
whole body.
2018-09-20 16:04:49 +03:00
Valentin Bartenev a2eca97e89 Controller: addressing of array elements in requests. 2018-09-20 15:27:14 +03:00
Valentin Bartenev 8d844bc2aa Controller: certificates storage interface. 2018-09-20 15:27:08 +03:00
Valentin Bartenev 2dfd8ffc2f Deduplicated string value initializations. 2018-09-20 15:27:06 +03:00
Valentin Bartenev 353db6f361 Fixed more typos.
Thanks to 洪志道 (Hong Zhi Dao).
2018-09-18 16:28:24 +03:00
Valentin Bartenev 4bc7a23ecf Fixed spelling in a comment.
This closes #161 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-09-10 14:55:15 +03:00
Valentin Bartenev 941616f893 Returning error for "make tests" when "--tests" wasn't configured. 2018-08-08 18:43:46 +03:00
Valentin Bartenev 4b67de4bbb Removed implicit call of nxt_thread() in nxt_thread_tid().
Explicit is better than implicit © The Zen of Python.

The nxt_thread_tid(NULL) call was used only twice in the code
and such behaviour was specific to nxt_thread_tid() function.
2018-07-27 17:52:21 +03:00
Valentin Bartenev de885e10cb Fixed configure process with non-default locale.
Overriding LANG might not work, since it has less precedence than LC_* settings.
LC_ALL has the highest precedence.

This should resolve issue #121 on GitHub.
2018-07-23 19:21:33 +03:00
Valentin Bartenev 7bdbb2cf2a Version bump. 2018-07-16 16:33:06 +03:00
Valentin Bartenev 92a7d9f0c6 Added tag 1.3 for changeset b3cf22b8a17e 2018-07-13 15:15:22 +03:00
Valentin Bartenev 604a904a47 Generated Dockerfiles for Unit 1.3. 2018-07-13 14:45:08 +03:00
Valentin Bartenev a1bf265d52 Added version 1.3 CHANGES. 2018-07-13 14:45:08 +03:00
Valentin Bartenev 8fd32c9394 Removed unused "nxt_app_header_field_t" structure.
It's not used since 3b77edf46701.
2018-07-11 16:53:11 +03:00
Valentin Bartenev 1abdcfb2d8 Controller: added "settings" configuration object.
It has the following structure and default values:

  {
      "http": {
          "header_read_timeout": 30,
          "body_read_timeout": 30,
          "send_timeout": 30,
          "idle_timeout": 180,
          "max_body_size": 8388608
      }
  }
2018-07-09 20:34:51 +03:00
Valentin Bartenev 5a05f569b7 Router: increased HTTP connection related limits. 2018-07-09 20:34:51 +03:00
Valentin Bartenev 7e3de003c7 PHP: fixed request body processing.
The implementation of module was based on the assumption that PHP reads request
body and headers in the particular order.  For the POST request the body goes
before headers and vice versa for all other requests.

But as it appeared later, this order is unspecified and depends on many factors,
including the particular code of PHP application.  Among other factors those
can affect ordering:

 - presence of "Content-Type" header;
 - "variables_order" php.ini setting;
 - "enable_post_data_reading" php.ini setting;
 - reading php://input by application;

and this list can be incomplete.

As a temporary workaround, request body now is always put before headers and it
is gracefully skipped whenever PHP wants to get headers.

This closes #144 issue on GitHub.
2018-07-05 16:43:45 +03:00
Valentin Bartenev 234deb51f4 PHP: fixed setting of individual configuration options.
The previous method changed PHP options only for the first request.
On the request completion the options were rolled back.

This closes #145 issue on GitHub.
2018-07-03 17:12:47 +03:00
Valentin Bartenev 11cecce114 HTTP parser: relaxed checking of fields values.
Allowing characters up to 0xFF doesn't conflict with RFC 7230.
Particularly, this make it possible to pass unencoded UTF-8 data
through HTTP headers, which can be useful.
2018-07-03 15:18:16 +03:00
Valentin Bartenev 0366bfad6d Fixed error message about "spare" value. 2018-07-02 18:19:00 +03:00
Valentin Bartenev 145d895430 Controller: fixed handling of zero Content-Length. 2018-07-02 16:36:59 +03:00
Valentin Bartenev 42e1d8e3b2 Packages: tar building functionality moved into pkg/Makefile. 2018-06-27 18:30:49 +03:00
Valentin Bartenev 1a52d876f7 Introduced nxt_length() macro. 2018-06-25 16:51:47 +03:00
Valentin Bartenev af31012815 More effective implementation of nxt_popcount().
This method requires as many iterations as there are set bits,
while the previous one has to shift up to the position of the
highest bit.
2018-06-21 16:40:02 +03:00
Valentin Bartenev e96374bfa1 Version bump. 2018-06-13 15:42:42 +03:00
Valentin Bartenev 0f0fb35620 Added tag 1.2 for changeset fbe7f5a3867e 2018-06-07 17:48:45 +03:00
Valentin Bartenev b1bdf309e2 Generated Dockerfiles for Unit 1.2. 2018-06-07 17:46:46 +03:00
Valentin Bartenev 9dd0fa87ad Added version 1.2 CHANGES. 2018-06-07 16:43:37 +03:00
Valentin Bartenev 8f278a5fed PHP: added setting of individual configuration options. 2018-06-07 16:17:32 +03:00
Valentin Bartenev 388390888b PHP: added setting of php.ini configuration file path. 2018-06-07 16:17:31 +03:00
Valentin Bartenev 771dc2f55e Exported functions for accessing configuration values. 2018-06-07 16:17:30 +03:00
Valentin Bartenev ceeb301881 Go: specifying command line arguments to the executable.
This closes #110 issue on GitHub.
2018-06-06 16:53:35 +03:00
Valentin Bartenev d7e6e2bd8c Configuration of environment variables for application processes. 2018-05-28 20:55:23 +03:00
Valentin Bartenev 3e8dbfe5ff Added SERVER_SOFTWARE request meta-variable. 2018-05-21 16:14:24 +03:00
Valentin Bartenev 10898568a3 Version bump. 2018-04-27 16:48:14 +03:00
Valentin Bartenev 4814fa7efe Added tag 1.1 for changeset 3f710b55c226 2018-04-26 18:33:11 +03:00
Valentin Bartenev 472e9b2a24 Generated Dockerfiles for Unit 1.1. 2018-04-26 18:31:13 +03:00
Valentin Bartenev 62a89eed60 Added version 1.1 CHANGES. 2018-04-26 18:30:06 +03:00
Valentin Bartenev d1b0f74550 Improved wording in CHANGES. 2018-04-26 16:47:55 +03:00
Valentin Bartenev 17160e9352 Python: added a missing slash in the path to "pyenv.cfg".
This closes #115 issue on GitHub.
2018-04-25 15:11:01 +03:00
Valentin Bartenev 749f7c0340 Support for PEP 405 virtual environments.
This closes #96 issue on GitHub.
2018-04-24 20:49:36 +03:00
Valentin Bartenev 5371891492 Fixed segfault when two modules have the same type and version.
The bug appeared in 217e48a3b091.
This closes #104 issue on GitHub.
2018-04-20 23:57:46 +03:00
Valentin Bartenev a20830ff55 Router: fixed race condition while access log reopening.
In order to reopen access log, the router process creates a memory pool
and allocates a buffer to send RPC message for the main process.

Previously, the memory pool was destroyed when RPC response handler was
called.  It appeared, that the buffer completion handler could be not
triggered by that time and still remained in a queue.

Now the memory pool is destroyed only after both events are happen.
2018-04-19 19:48:58 +03:00
Valentin Bartenev b06a0c95d0 Removed duplicating socket address parsing function.
This also fixes #101 issue on GitHub.  The function previously used to
parse IPv6 address of control socket was broken.  Now the working function
is used instead.
2018-04-18 17:28:22 +03:00
Valentin Bartenev 54ccb32333 Added missing cleanup when nxt_port_socket_write() failed. 2018-04-18 17:28:04 +03:00
Valentin Bartenev ab4f867996 Added missing checks if nxt_port_rpc_register_handler() failed.
This closes #97 issue on GitHub.
Thanks to 洪志道 (Hong Zhi Dao).
2018-04-17 21:13:43 +03:00
Valentin Bartenev 555141f798 Improved "unitd" command line help. 2018-04-13 20:07:02 +03:00
Valentin Bartenev 115949c50f Version bump. 2018-04-13 19:10:15 +03:00
Valentin Bartenev 1c19c6f1ad Added tag 1.0 for changeset 5870dd420309 2018-04-12 19:50:37 +03:00
Valentin Bartenev 8912dea621 Generated Dockerfiles for Unit 1.0. 2018-04-12 19:47:37 +03:00
Valentin Bartenev 32eb649e7c Added version 1.0 CHANGES. 2018-04-12 19:47:33 +03:00
Valentin Bartenev 946cfa32a8 Version bump. 2018-04-12 19:39:25 +03:00
Valentin Bartenev 07b554c2b4 Configure scripts cleanup.
Thanks to 洪志道 (Hong Zhi Dao).
2018-04-11 18:29:48 +03:00
Valentin Bartenev c610b35649 Controller: added "/config" prefix for the configuration object. 2018-04-11 18:23:58 +03:00
Valentin Bartenev da61cfd98b Access log reopening. 2018-04-11 18:23:58 +03:00
Valentin Bartenev 204c394721 Initial access log support. 2018-04-11 18:23:33 +03:00
Valentin Bartenev dc75c83950 Fixed pipelined request processing, broken by 9e16499b63f0. 2018-04-11 12:49:58 +03:00
Valentin Bartenev 41317e37da HTTP parser: saving partial method.
This is useful for log purposes.
2018-04-10 16:51:22 +03:00
Valentin Bartenev 8d697e8004 HTTP parser: saving unsupported version.
This is useful for log purposes.
2018-04-10 16:51:22 +03:00
Valentin Bartenev b1b9c78362 HTTP parser: correct "target" for partial or invalid request line. 2018-04-10 16:51:22 +03:00
Valentin Bartenev eb51264710 Processing of partially parsed HTTP header.
This is useful for log purposes.
2018-04-09 19:16:19 +03:00
Valentin Bartenev 96927e7d0c Controller: fixed a memory leak when PUT operation failed.
Thanks to 洪志道 (Hong Zhi Dao).
2018-04-08 14:08:06 +03:00
Valentin Bartenev c0a423aa74 Fixed NXT_INT64_T_HEXLEN.
This closes #89 issue on GitHub.
Thanks to hongzhidao.
2018-04-05 15:54:08 +03:00