]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: connection: add new error codes for accept_conn()
authorWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2020 06:23:57 +0000 (08:23 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 Oct 2020 19:47:56 +0000 (21:47 +0200)
accept_conn() will be used to accept an incoming connection and return it.
It will have to deal with various error codes. The currently identified
ones were created as CO_AC_*.

include/haproxy/connection-t.h

index 41d50cc1129d2efcb702293be0ec42a09dac5f84..d096f53ef9a610fcd9a6aa73eef88333ec12fd74 100644 (file)
@@ -243,6 +243,16 @@ enum {
        CO_ER_SOCKS4_ABORT,      /* SOCKS4 Proxy handshake aborted by server */
 };
 
+/* error return codes for accept_conn() */
+enum {
+       CO_AC_NONE = 0,  /* no error, valid connection returned */
+       CO_AC_DONE,      /* reached the end of the queue (typically EAGAIN) */
+       CO_AC_RETRY,     /* late signal delivery or anything requiring the caller to try again */
+       CO_AC_YIELD,     /* short-lived limitation that requires a short pause */
+       CO_AC_PAUSE,     /* long-lived issue (resource/memory allocation error, paused FD) */
+       CO_AC_PERMERR,   /* permanent, non-recoverable error (e.g. closed listener socket) */
+};
+
 /* source address settings for outgoing connections */
 enum {
        /* Tproxy exclusive values from 0 to 7 */