summaryrefslogtreecommitdiffhomepage
path: root/src/event/modules/ngx_win32_select_module.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-10-17Events: available bytes calculation via ioctl(FIONREAD).Maxim Dounin1-0/+1
This makes it possible to avoid looping for a long time while working with a fast enough peer when data are added to the socket buffer faster than we are able to read and process them (ticket #1431). This is basically what we already do on FreeBSD with kqueue, where information about the number of bytes in the socket buffer is returned by the kevent() call. With other event methods rev->available is now set to -1 when the socket is ready for reading. Later in ngx_recv() and ngx_recv_chain(), if full buffer is received, real number of bytes in the socket buffer is retrieved using ioctl(FIONREAD). Reading more than this number of bytes ensures that even with edge-triggered event methods the event will be triggered again, so it is safe to stop processing of the socket and switch to other connections. Using ioctl(FIONREAD) only after reading a full buffer is an optimization. With this approach we only call ioctl(FIONREAD) when there are at least two recv()/readv() calls.
2019-01-24Win32: detection of connect() errors in select().Maxim Dounin1-4/+13
On Windows, connect() errors are only reported via exceptfds descriptor set from select(). Previously exceptfds was set to NULL, and connect() errors were not detected at all, so connects to closed ports were waiting till a timeout occurred. Since ongoing connect() means that there will be a write event active, except descriptor set is copied from the write one. While it is possible to construct except descriptor set as a concatenation of both read and write descriptor sets, this looks unneeded. With this change, connect() errors are properly detected now when using select(). Note well that it is not possible to detect connect() errors with WSAPoll() (see https://daniel.haxx.se/blog/2012/10/10/wsapoll-is-broken/).
2017-03-02Added missing static specifiers.Eran Kornblau1-2/+2
2015-03-20Removed unix ngx_threaded and related ngx_process_changes.Ruslan Ermilov1-1/+0
2015-03-14Thread pools implementation.Valentin Bartenev1-0/+1
2014-09-01Events: processing of posted events changed from LIFO to FIFO.Valentin Bartenev1-1/+2
In theory, this can provide a bit better distribution of latencies. Also it simplifies the code, since ngx_queue_t is now used instead of custom implementation.
2014-09-01Events: removed broken thread support from posted events.Valentin Bartenev1-7/+4
It's mostly dead code. And the idea of thread support for this task has been deprecated.
2013-09-04Win32: MinGW GCC compatibility.Maxim Dounin1-2/+2
Several warnings silenced, notably (ngx_socket_t) -1 is now checked on socket operations instead of -1, as ngx_socket_t is unsigned on win32 and gcc complains on comparison. With this patch, it's now possible to compile nginx using mingw gcc, with options we normally compile on win32.
2012-01-18Copyright updated.Maxim Konovalov1-0/+1
2010-03-25*) introduce ngx_time_sigsafe_update() to update the error log time onlyIgor Sysoev1-1/+1
*) change ngx_time_update() interface
2010-03-13*) use previously cached GMT offset value to update time from a signal handlerIgor Sysoev1-1/+1
*) change ngx_time_update() interface since there are no notification methods those return time
2009-11-23add NGX_PROCESS_HELPER process statusIgor Sysoev1-1/+1
2009-08-25style fixIgor Sysoev1-5/+1
2009-05-06divide select module into two modules: Unix and Win32 onesIgor Sysoev1-0/+403