haproxy/include/proto
Willy Tarreau cff6411f9a [MAJOR] add a connection error state to the stream_interface
Tracking connection status changes was hard, and some code was
redundant. A new SI_ST_CER state was added to the stream interface
to indicate a past connection error, and an SI_FL_ERR flag was
added to report past I/O error. The stream_sock code does not set
the connection to SI_ST_CLO anymore in case of I/O error, it's
the upper layer which does it. This makes it possible to know
exactly when the file descriptors are allocated.

The new SI_ST_CER state permitted to split tcp_connection_status()
in two parts, one processing SI_ST_CON and the other one SI_ST_CER.
Synchronous connection errors now make use of this last state, hence
eliminating duplicate code.

Some ib<->ob copy paste errors were found and fixed, and all entities
setting SI_ST_CLO also shut the buffers down.

Some of these stream_interface specific functions and structures
have migrated to a new stream_interface.c file.

Some types of errors are still not detected by the buffers. For
instance, let's assume the following scenario in one single pass
of process_session: a connection sits in SI_ST_TAR state during
a retry. At TAR expiration, a new connection attempt is made, the
connection is obtained and srv->cur_sess is increased. Then the
buffer timeout is fires and everything is cleared, the new state
becomes SI_ST_CLO. The cleaning code checks that previous state
was either SI_ST_CON or SI_ST_EST to release the connection. But
that's wrong because last state is still SI_ST_TAR. So the
server's connection count does not get decreased.

This means that prev_state must not be used, and must be replaced
by some transition detection instead of level detection.

The following debugging line was useful to track state changes :

  fprintf(stderr, "%s:%d: cs=%d ss=%d(%d) rqf=0x%08x rpf=0x%08x\n", __FUNCTION__, __LINE__,
          s->si[0].state, s->si[1].state, s->si[1].err_type, s->req->flags, s-> rep->flags);
2008-11-03 06:26:53 +01:00
..
acl.h [MEDIUM] acl: when possible, report the name and requirements of ACLs in warnings 2008-08-03 09:41:05 +02:00
backend.h [MAJOR] migrate the connection logic to stream interface 2008-11-02 10:19:10 +01:00
buffers.h [MAJOR] migrate the connection logic to stream interface 2008-11-02 10:19:10 +01:00
checks.h [MEDIUM] Spread health checks even more 2007-10-15 09:33:10 +02:00
client.h [CLEANUP] remove unused include/types/client.h 2008-07-16 10:30:40 +02:00
cttproxy.h [MEDIUM] check for cttproxy support when required 2007-03-24 17:24:39 +01:00
dumpstats.h [MEDIUM] modularize the global "stats" keyword configuration parser 2008-07-09 20:12:41 +02:00
fd.h [MEDIUM] Fix memory freeing at exit 2008-05-30 07:07:19 +02:00
hdr_idx.h [MAJOR] huge rework of the HTTP request FSM 2007-01-21 19:16:41 +01:00
httperr.h [MEDIUM] errorloc now checked first from backend then from frontend 2006-12-24 17:47:20 +01:00
log.h [CLEANUP] remove many #include <types/xxx> from C files 2008-07-16 10:30:42 +02:00
proto_http.h [MAJOR] rework of the server FSM 2008-11-02 10:19:04 +01:00
proto_tcp.h [MAJOR] implement tcp request content inspection 2008-07-16 10:29:07 +02:00
proto_uxst.h [MAJOR] convert all expiration timers from timeval to ticks 2008-07-07 00:09:58 +02:00
protocols.h [MINOR] add a generic unbind_all_listeners() primitive 2007-11-04 22:42:49 +01:00
proxy.h [MEDIUM] modularize the "timeout" keyword configuration parser 2008-07-09 20:34:27 +02:00
queue.h [BUG] fix the dequeuing logic to ensure that all requests get served 2008-06-20 15:08:06 +02:00
senddata.h [MEDIUM] moved stats and buffer generic functions to new files 2007-10-18 14:12:21 +02:00
server.h [MEDIUM]: rework checks handling 2008-01-22 11:29:06 +01:00
session.h [MINOR] term_trace: add better instrumentations to trace the code 2008-08-16 14:55:08 +02:00
stream_interface.h [MAJOR] add a connection error state to the stream_interface 2008-11-03 06:26:53 +01:00
stream_sock.h [MAJOR] add a connection error state to the stream_interface 2008-11-03 06:26:53 +01:00
task.h [MEDIUM] indicate a reason for a task wakeup 2008-11-02 10:19:08 +01:00
template.h [CLEANUP] included common/version.h everywhere 2006-06-29 18:54:54 +02:00