]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn_stream: new shutr/w status flags
authorWilly Tarreau <w@1wt.eu>
Thu, 5 Oct 2017 13:06:07 +0000 (15:06 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 Oct 2017 17:03:23 +0000 (18:03 +0100)
In order to support all shutdown modes on the CS, we introduce the
following flags :
  CS_FL_SHRD : shut read, drain extra data
  CS_FL_SHRR : shut read, reset extra data
  CS_FL_SHWN : shut write, normal notification
  CS_FL_SHWS : shut write, silent mode (no notification)

And the following modes for shutr/shutw :

  CS_SHR_DRAIN, CS_SHR_RESET, CS_SHW_NORMAL, CS_SHW_SILENT.

Note: it's possible that we won't need to distinguish the two shutw
above as they're only an action.

For now they are not used.

include/types/connection.h

index 0d62efc99caae05c94b9e8fce60e2aca9c5b6a27..1b3e73a8c087663cca9acb810f051a15142583ee 100644 (file)
@@ -58,10 +58,31 @@ enum {
        CS_FL_DATA_RD_ENA   = 0x00000001,  /* receiving data is allowed */
        CS_FL_DATA_WR_ENA   = 0x00000002,  /* sending data is desired */
 
+       CS_FL_SHRD          = 0x00000010,  /* read shut, draining extra data */
+       CS_FL_SHRR          = 0x00000020,  /* read shut, resetting extra data */
+       CS_FL_SHR           = CS_FL_SHRD | CS_FL_SHRR, /* read shut status */
+
+       CS_FL_SHWN          = 0x00000040,  /* write shut, verbose mode */
+       CS_FL_SHWS          = 0x00000080,  /* write shut, silent mode */
+       CS_FL_SHW           = CS_FL_SHWN | CS_FL_SHWS, /* write shut status */
+
+
        CS_FL_ERROR         = 0x00000100,  /* a fatal error was reported */
        CS_FL_EOS           = 0x00001000,  /* End of stream */
 };
 
+/* cs_shutr() modes */
+enum cs_shr_mode {
+       CS_SHR_DRAIN        = 0,           /* read shutdown, drain any extra stuff */
+       CS_SHR_RESET        = 1,           /* read shutdown, reset any extra stuff */
+};
+
+/* cs_shutw() modes */
+enum cs_shw_mode {
+       CS_SHW_NORMAL       = 0,           /* regular write shutdown */
+       CS_SHW_SILENT       = 1,           /* imminent close, don't notify peer */
+};
+
 /* For each direction, we have a CO_FL_{SOCK,DATA}_<DIR>_ENA flag, which
  * indicates if read or write is desired in that direction for the respective
  * layers. The current status corresponding to the current layer being used is