]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: fd: add a new "initialized" bit in the fdtab struct
authorWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 12:36:10 +0000 (14:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 30 Aug 2019 13:07:25 +0000 (15:07 +0200)
The purpose is to be able to remember that initialization was already
done for a file descriptor. This will allow to get rid of some dirty
hacks performed in the logs or fd sinks where the init state of the
fd has to be guessed.

include/types/fd.h

index 35d3bc2376c7c4ccab95428f8a0ac1b29679d70c..b96abc09d6fc2f8d67f9e97fb38e28ad77c251ec 100644 (file)
@@ -127,6 +127,7 @@ struct fdtab {
        unsigned char ev;                    /* event seen in return of poll() : FD_POLL_* */
        unsigned char linger_risk:1;         /* 1 if we must kill lingering before closing */
        unsigned char cloned:1;              /* 1 if a cloned socket, requires EPOLL_CTL_DEL on close */
+       unsigned char initialized:1;         /* 1 if init phase was done on this fd (e.g. set non-blocking) */
 }
 #ifdef USE_THREAD
 /* only align on cache lines when using threads; 32-bit small archs