summaryrefslogtreecommitdiffhomepage
path: root/src/core (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-03-26Core: guard against spinlock usage without atomic ops.Ruslan Ermilov1-1/+1
The new thread pools code uses spinlocks.
2015-04-07Core: limited levels of subdirectory hierarchy used for temp files.Sergey Kandaurov1-0/+4
Similar to ngx_http_file_cache_set_slot(), the last component of file->name with a fixed length of 10 bytes, as generated in ngx_create_temp_path(), is used as a source for the names of intermediate subdirectories with each one taking its own part. Ensure that the sum of specified levels with slashes fits into the length (ticket #731).
2015-04-07Core: removed excessive initialization in ngx_conf_set_path_slot().Sergey Kandaurov1-4/+0
Level hierarchy is pre-zeroed in ngx_pcalloc() of the surrounding ngx_path_t.
2015-04-07Core: fixed error handling on ngx_conf_full_name() failure.Sergey Kandaurov1-1/+1
2015-03-26Version bump.Maxim Dounin1-2/+2
2015-03-23Output chain: free chain links in ngx_chain_writer().Maxim Dounin1-4/+12
2015-03-23Output chain: zero size buf alerts in ngx_chain_writer().Maxim Dounin1-1/+32
Now we log a "zero size buf in chain writer" alert if we encounter a zero sized buffer in ngx_chain_writer(), and skip the buffer.
2015-03-23Thread pools: implemented graceful exiting of threads.Valentin Bartenev1-3/+34
2015-03-23Thread pools: removed unused pointer to memory pool.Valentin Bartenev1-2/+0
No functional changes.
2015-03-23Thread pools: keep waiting tasks mutex in ngx_thread_pool_t.Valentin Bartenev1-45/+20
It's not needed for completed tasks queue since the previous change. No functional changes.
2015-03-23Thread pools: replaced completed tasks queue mutex with spinlock.Valentin Bartenev1-16/+5
2015-03-23Removed stub implementation of win32 mutexes.Ruslan Ermilov1-10/+0
2015-03-19Core: added cyclic memory buffer support for error_log.Valentin Bartenev1-0/+120
Example of usage: error_log memory:16m debug; This allows to configure debug logging with minimum impact on performance. It's especially useful when rare crashes are experienced under high load. The log can be extracted from a coredump using the following gdb script: set $log = ngx_cycle->log while $log->writer != ngx_log_memory_writer set $log = $log->next end set $buf = (ngx_log_memory_buf_t *) $log->wdata dump binary memory debug_log.txt $buf->start $buf->end
2015-03-20Removed ngx_connection_t.lock.Ruslan Ermilov2-16/+0
2015-03-19Thread pools: silence warning on process exit.Ruslan Ermilov1-0/+7
Work around pthread_cond_destroy() and pthread_mutex_destroy() returning EBUSY. A proper solution would be to ensure all threads are terminated.
2015-03-19Thread pools: fixed the waiting tasks accounting.Ruslan Ermilov1-7/+8
Behave like POSIX semaphores. If N worker threads are waiting for tasks, at least that number of tasks should be allowed to be put into the queue.
2015-03-19Thread pools: keep waiting tasks counter in ngx_thread_pool_t.Ruslan Ermilov1-9/+7
It's not needed for completed tasks queue. No functional changes.
2015-03-14Added support for offloading Linux sendfile() in thread pools.Valentin Bartenev1-0/+4
2015-03-14Added support for offloading read() in thread pools.Valentin Bartenev3-10/+38
2015-03-14Thread pools implementation.Valentin Bartenev3-0/+671
2015-03-04Renamed NGX_THREADS to NGX_OLD_THREADS because of deprecation.Ruslan Ermilov7-12/+16
It's mostly dead code and the original idea of worker threads has been rejected.
2015-03-17Overflow detection in ngx_inet_addr().Ruslan Ermilov1-2/+6
2015-03-17Core: overflow detection in ngx_parse_time() (ticket #732).Ruslan Ermilov1-16/+37
2015-03-17Refactored ngx_parse_time().Ruslan Ermilov1-3/+1
No functional changes.
2015-03-17Core: overflow detection in number parsing functions.Ruslan Ermilov2-52/+72
2015-03-17Core: expose maximum values of time_t and ngx_int_t.Ruslan Ermilov1-0/+3
These are needed to detect overflows.
2015-03-04Log: use ngx_cpymem() in a couple of places, no functional changes.Valentin Bartenev1-6/+3
2015-02-24Core: fixed potential buffer overrun when initializing hash.Maxim Dounin1-1/+1
Initial size as calculated from the number of elements may be bigger than max_size. If this happens, make sure to set size to max_size. Reported by Chris West.
2015-02-17Core: make ngx_connection_local_sockaddr() always assign address.Roman Arutyunyan1-17/+17
Previously, this function checked for connection local address existence and returned error if it was missing. Now a new address is assigned in this case making it possible to call this function not only for accepted connections.
2015-02-11Unbreak building on FreeBSD without file AIO.Valentin Bartenev1-1/+1
It appeared that the NGX_HAVE_AIO_SENDFILE macro was defined regardless of the "--with-file-aio" configure option and the NGX_HAVE_FILE_AIO macro. Now they are related. Additionally, fixed one macro.
2015-02-11Refactored sendfile() AIO preload.Valentin Bartenev3-2/+35
This reduces layering violation and simplifies the logic of AIO preread, since it's now triggered by the send chain function itself without falling back to the copy filter. The context of AIO operation is now stored per file buffer, which makes it possible to properly handle cases when multiple buffers come from different locations, each with its own configuration.
2015-02-11Version bump.Ruslan Ermilov1-2/+2
2015-02-10Core: fixed build on Tru64 UNIX.Sergey Kandaurov1-1/+1
There was a typo in NGX_EACCES. Reported by Goetz T. Fischer.
2015-02-04Core: fixed a race resulting in extra sem_post()'s.Roman Arutyunyan1-1/+2
The mtx->wait counter was not decremented if we were able to obtain the lock right after incrementing it. This resulted in unneeded sem_post() calls, eventually leading to EOVERFLOW errors being logged, "sem_post() failed while wake shmtx (75: Value too large for defined data type)". To close the race, mtx->wait is now decremented if we obtain the lock right after incrementing it in ngx_shmtx_lock(). The result can become -1 if a concurrent ngx_shmtx_unlock() decrements mtx->wait before the added code does. However, that only leads to one extra iteration in the next call of ngx_shmtx_lock().
2015-02-02Core: reverted prefix-based temp files (a9138c35120d).Roman Arutyunyan2-21/+8
The use_temp_path http cache feature is now implemented using a separate temp hierarchy in cache directory. Prefix-based temp files are no longer needed.
2015-02-02Core: supported directory skipping in ngx_walk_tree().Roman Arutyunyan1-1/+9
If pre_tree_handler() returns NGX_DECLINED, the directory is ignored.
2015-01-28Fixed AIO handling in the output chain.Valentin Bartenev1-2/+6
The ctx->aio flag must be taken into account in the short path too.
2015-01-27A bounds check of %N format on Windows.Igor Sysoev1-1/+5
Thanks to Joe Bialek, Adam Zabrocki and Microsoft Vulnerability Research.
2015-01-13Core: added disk_full_time checks to error log.Maxim Dounin2-4/+23
2014-12-26Core: added prefix-based temporary files.Valentin Bartenev2-8/+21
Now, if the "path" parameter is NULL, ngx_create_temp_file() will use file->name as a predefined file path prefix.
2014-12-26Unified handling of ngx_create_temp_file() return value.Valentin Bartenev1-1/+1
The original check for NGX_AGAIN was surplus, since the function returns only NGX_OK or NGX_ERROR. Now it looks similar to other places. No functional changes.
2014-12-24Version bump.Maxim Dounin1-2/+2
2014-12-12Autoindex: implemented JSON output format.Valentin Bartenev2-0/+53
2014-12-04Version bump.Maxim Dounin1-2/+2
2014-11-28Typo.Maxim Dounin1-1/+1
2014-11-20Syslog: allowed underscore symbol in tag (ticket #667).Vladimir Homutov1-2/+3
2014-11-20Resolver: fixed debug event logging.Ruslan Ermilov2-17/+23
In 954867a2f0a6, we switched to using resolver node as the timer event data. This broke debug event logging. Replaced now unused ngx_resolver_ctx_t.ident with ngx_resolver_node_t.ident so that ngx_event_ident() extracts something sensible when accessing ngx_resolver_node_t as ngx_connection_t.
2014-11-20Resolver: fixed use-after-free memory access.Ruslan Ermilov1-4/+4
In 954867a2f0a6, we switched to using resolver node as the timer event data, so make sure we do not free resolver node memory until the corresponding timer is deleted.
2014-08-13Moved the code for coalescing file buffers to a separate function.Valentin Bartenev2-0/+44
2014-11-19Renamed ngx_handle_sent_chain() to ngx_chain_update_sent().Valentin Bartenev2-2/+2
No functional changes.