haproxy/src
Willy Tarreau f817e9f473 MAJOR: polling: rework the whole polling system
This commit heavily changes the polling system in order to definitely
fix the frequent breakage of SSL which needs to remember the last
EAGAIN before deciding whether to poll or not. Now we have a state per
direction for each FD, as opposed to a previous and current state
previously. An FD can have up to 8 different states for each direction,
each of which being the result of a 3-bit combination. These 3 bits
indicate a wish to access the FD, the readiness of the FD and the
subscription of the FD to the polling system.

This means that it will now be possible to remember the state of a
file descriptor across disable/enable sequences that generally happen
during forwarding, where enabling reading on a previously disabled FD
would result in forgetting the EAGAIN flag it met last time.

Several new state manipulation functions have been introduced or
adapted :
  - fd_want_{recv,send} : enable receiving/sending on the FD regardless
    of its state (sets the ACTIVE flag) ;

  - fd_stop_{recv,send} : stop receiving/sending on the FD regardless
    of its state (clears the ACTIVE flag) ;

  - fd_cant_{recv,send} : report a failure to receive/send on the FD
    corresponding to EAGAIN (clears the READY flag) ;

  - fd_may_{recv,send}  : report the ability to receive/send on the FD
    as reported by poll() (sets the READY flag) ;

Some functions are used to report the current FD status :

  - fd_{recv,send}_active
  - fd_{recv,send}_ready
  - fd_{recv,send}_polled

Some functions were removed :
  - fd_ev_clr(), fd_ev_set(), fd_ev_rem(), fd_ev_wai()

The POLLHUP/POLLERR flags are now reported as ready so that the I/O layers
knows it can try to access the file descriptor to get this information.

In order to simplify the conditions to add/remove cache entries, a new
function fd_alloc_or_release_cache_entry() was created to be used from
pollers while scanning for updates.

The following pollers have been updated :

   ev_select() : done, built, tested on Linux 3.10
   ev_poll()   : done, built, tested on Linux 3.10
   ev_epoll()  : done, built, tested on Linux 3.10 & 3.13
   ev_kqueue() : done, built, tested on OpenBSD 5.2
2014-01-26 00:42:30 +01:00
..
acl.c BUG/MINOR: acl: parser must also stop at comma on ACL-only keywords 2013-12-16 22:01:06 +01:00
appsession.c BUILD: definitely silence some stupid GCC warnings 2013-12-13 15:21:36 +01:00
arg.c MINOR: arg: improve wording on error reporting 2013-12-13 00:38:47 +01:00
auth.c MINOR: acl/pattern: use types different from int to clarify who does what. 2013-12-02 23:31:33 +01:00
backend.c MINOR: http: try to stick to same server after status 401/407 2013-12-23 15:12:44 +01:00
base64.c [MINOR] add encode/decode function for 30-bit integers from/to base64 2010-10-30 19:04:33 +02:00
buffer.c MINOR: buffer: align the last output line if there are less than 8 characters left 2013-11-21 08:07:04 +01:00
cfgparse.c MEDIUM: config: report a warning when multiple servers have the same name 2014-01-03 12:20:22 +01:00
channel.c MAJOR: channel: add a new flag CF_WAKE_WRITE to notify the task of writes 2013-12-31 18:37:36 +01:00
checks.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
chunk.c MINOR: chunks: always initialize the output chunk in get_trash_chunk() 2013-12-14 16:02:18 +01:00
compression.c MEDIUM: sample: systematically pass the keyword pointer to the keyword 2013-08-01 21:17:13 +02:00
connection.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
cttproxy.c CLEANUP: cttproxy: remove a warning on undeclared close() 2012-10-05 22:18:07 +02:00
dumpstats.c REORG: polling: rename "fd_spec" to "fd_cache" 2014-01-26 00:42:29 +01:00
ev_epoll.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
ev_kqueue.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
ev_poll.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
ev_select.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
fd.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
freq_ctr.c BUG/MINOR: time: frequency counters are not totally accurate 2012-12-29 21:50:07 +01:00
frontend.c MEDIUM: connection: centralize handling of nolinger in fd management 2013-12-16 02:23:52 +01:00
haproxy-systemd-wrapper.c BUILD/MINOR: systemd: fix compiler warning about unused result 2013-12-10 08:50:55 +01:00
haproxy.c REORG: polling: rename "fd_process_spec_events()" to "fd_process_cached_events()" 2014-01-26 00:42:29 +01:00
hash.c MEDIUM: backend: add support for the wt6 hash 2013-11-14 16:37:50 +01:00
hdr_idx.c OPTIM/MINOR: move the hdr_idx pools out of the proxy struct 2011-10-24 18:15:04 +02:00
i386-linux-vsys.c MEDIUM: listener: add support for linux's accept4() syscall 2012-10-08 20:11:03 +02:00
lb_chash.c BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
lb_fas.c BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
lb_fwlc.c BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
lb_fwrr.c BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
lb_map.c BUG/MAJOR: server: weight calculation fails for map-based algorithms 2013-11-21 15:09:02 +01:00
listener.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
log.c BUG/MEDIUM: unique_id: HTTP request counter is not stable 2014-01-25 11:07:06 +01:00
map.c MINOR: map: export parse output sample functions 2013-12-12 15:44:05 +01:00
memory.c MEDIUM: memory: add the ability to poison memory at run time 2012-05-08 21:28:16 +02:00
pattern.c MINOR: pattern: move functions for grouping pat_match_* and pat_parse_* and add documentation. 2014-01-21 22:14:21 +01:00
payload.c BUG/MINOR: payload: the patterns of the acl "req.ssl_ver" are no parsed with the good function. 2014-01-25 02:50:58 +01:00
peers.c MEDIUM: peers: delay appctx initialization 2013-12-09 15:40:23 +01:00
pipe.c BUILD/MINOR: silent a build warning in src/pipe.c (fcntl) 2011-10-24 17:09:22 +02:00
proto_http.c BUG/MAJOR: fix freezes during compression 2014-01-25 22:28:22 +01:00
proto_tcp.c MAJOR: polling: rework the whole polling system 2014-01-26 00:42:30 +01:00
proto_uxst.c MAJOR: listener: support inheriting a listening fd from the parent 2013-03-11 01:30:01 +01:00
protocol.c REORG: split "protocols" files into protocol and listener 2012-09-15 22:29:32 +02:00
proxy.c MEDIUM: checks: add send/expect tcp based check 2013-12-06 11:50:47 +01:00
queue.c MAJOR: connection: replace struct target with a pointer to an enum 2012-11-12 00:42:33 +01:00
raw_sock.c BUG/MAJOR: connection: fix mismatch between rcv_buf's API and usage 2014-01-15 01:09:48 +01:00
rbtree.c [MINOR] imported the rbtree function from Linux kernel 2007-01-07 02:12:57 +01:00
regex.c MINOR: regex: Copy the original regex expression into string. 2013-12-12 15:43:34 +01:00
sample.c BUG/MEDIUM: sample: simplify and fix the argument parsing 2013-12-13 01:33:33 +01:00
server.c MINOR: checks: use check->state instead of srv->state & SRV_CHECKED 2013-12-14 16:02:19 +01:00
session.c BUG/MEDIUM: unique_id: HTTP request counter is not stable 2014-01-25 11:07:06 +01:00
sessionhash.c [PATCH] appsessions: cleanup DEBUG_HASH and initialize request_counter 2008-08-13 23:43:26 +02:00
shctx.c BUG/MEDIUM: shctx: makes the code independent on SSL runtime version. 2013-04-26 19:15:52 +02:00
signal.c BUG/MEDIUM: signal: signal handler does not properly check for signal bounds 2013-01-24 16:19:19 +01:00
ssl_sock.c MEDIUM: connection: update callers of ctrl->drain() to use conn_drain() 2014-01-20 22:27:17 +01:00
standard.c MINOR: standard: The parse_binary() returns the length consumed and his documentation is updated 2014-01-21 22:14:44 +01:00
stick_table.c BUG/MEDIUM: acl: fix regression introduced by latest converters support 2013-12-05 02:23:13 +01:00
stream_interface.c BUG/MEDIUM: stream-interface: don't wake the task up before end of transfer 2014-01-25 22:28:22 +01:00
task.c [OPTIM] task: don't scan the run queue if we know it's empty 2011-09-10 20:08:49 +02:00
time.c BUG/MINOR: time: frequency counters are not totally accurate 2012-12-29 21:50:07 +01:00
trace.c MINOR: add a new function call tracer for debugging purposes 2012-05-26 00:12:37 +02:00
uri_auth.c BUG/MEDIUM: uri_auth: missing NULL check and memory leak on memory shortage 2013-01-24 16:19:19 +01:00