vcl: improve shutdown()
This commit does following:
- Change the behavior of shutdown() with SHUT_RDWR flag.
- Check SHUT_RD flag when read()
- Change the errno when write() after SHUT_WR
- Remove unused code
All the above modification passed the packetdrill test.
Type: improvement
Signed-off-by: liuyacan <liuyacan@corp.netease.com>
Change-Id: I0c81f52e563562e58580d70976526b898e65e915
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index 628b731..5b19f94 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -126,8 +126,6 @@
VCL_SESS_ATTR_TCP_NODELAY, // SOL_TCP,TCP_NODELAY
VCL_SESS_ATTR_TCP_KEEPIDLE, // SOL_TCP,TCP_KEEPIDLE
VCL_SESS_ATTR_TCP_KEEPINTVL, // SOL_TCP,TCP_KEEPINTVL
- VCL_SESS_ATTR_SHUT_RD,
- VCL_SESS_ATTR_SHUT_WR,
VCL_SESS_ATTR_MAX
} vppcom_session_attr_t;
@@ -137,7 +135,8 @@
VCL_SESSION_F_IS_VEP = 1 << 1,
VCL_SESSION_F_IS_VEP_SESSION = 1 << 2,
VCL_SESSION_F_HAS_RX_EVT = 1 << 3,
- VCL_SESSION_F_SHUTDOWN = 1 << 4,
+ VCL_SESSION_F_RD_SHUTDOWN = 1 << 4,
+ VCL_SESSION_F_WR_SHUTDOWN = 1 << 5,
} __clib_packed vcl_session_flags_t;
typedef struct vcl_session_