summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-03-11Style.Andrey Zelenkov1-2/+2
2019-02-28Various libunit fixes.Max Romanov1-8/+26
This patch contains various logging improvements and bugfixes found during Java module development.
2019-02-27Fixed processing of SERVER_NAME after 77aad2c142a0.Valentin Bartenev1-57/+0
Previously, the nxt_router_prepare_msg() function expected server host among other headers unmodified. It's not true anymore since normalization of the Host header has been introduced in 77aad2c142a0. The nxt_unit_split_host() function was removed. It didn't work correctly with IPv6 literals. Anyway, after 77aad2c142a0 the port splitting is done in router while Host header processing.
2019-02-21Initializing incoming buffer queue in a proper place.Sergey Kandaurov1-2/+2
In case nxt_unit_tracking_read() failed, execution would jump to the error path, where it could try to release buffers from uninitialized yet incoming_buf queue.
2018-10-31Node.js: added async request execution.Alexander Borisov1-2/+1
2018-10-02Filling cmsghdr with 0 to pass Go 1.11 message validation.Max Romanov1-4/+5
2018-10-02Making port fd blocking on app side and non-blocking in Unit.Max Romanov1-1/+10
This issue was introduced in libunit commit (e0f0cd7d244a). All port sockets in application should be in blocking mode whereas Unit itself operates non-blocking sockets. Having non-blocking sockets in application may cause send error during intensive response packets generation. See https://mailman.nginx.org/pipermail/unit/2018-October/000080.html.
2018-08-07Removing non-required warning.Max Romanov1-5/+0
2018-08-07Improved 'invalid file descriptor' diagnostic.Max Romanov1-0/+14
Unit router process may send mmap file decritptor to the application process for further information exchange. During this process there may be various errors, which should be described in application error log. If file descriptor cannot be properly transferred with 'new mmap' message, fd variable will be assigned to -1 and further syscalls using this file descriptor will fail. For 'new port' message fd is checked in the same way. This commit adds early 'invalid file descriptor' diagnostic and write corresponding message to error log. Found by Coverity (CID 308515).
2018-08-07Fixed unit library mutex usage.Max Romanov1-0/+6
For the optimization purpose, function nxt_unit_remove_process() expects lib->mutex to be locked. The function then moves ports queue into temporary queue and releases mutex. In nxt_unit_done() there were two errors: mutex was not locked before nxt_unit_remove_process() call and mutex was not destroyed. It is hard to tell what was possible negative impact of this errors. Found by Coverity (CID 308517).
2018-08-06Unit application library.Max Romanov1-0/+3630
Library now used in all language modules. Old 'nxt_app_*' code removed. See src/test/nxt_unit_app_test.c for usage sample.