From: Christopher Faulet Date: Tue, 4 Feb 2025 10:21:23 +0000 (+0100) Subject: CLEANUP: mux-spop: Remove useless comments X-Git-Tag: v3.2-dev5~25 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb4e517489cd0320decd02618427b28e6a3af5d4;p=thirdparty%2Fhaproxy.git CLEANUP: mux-spop: Remove useless comments Just a small cleanup to remove some comments added during the development of the mux. --- diff --git a/include/haproxy/mux_spop-t.h b/include/haproxy/mux_spop-t.h index 2e6c3c5de..59a224613 100644 --- a/include/haproxy/mux_spop-t.h +++ b/include/haproxy/mux_spop-t.h @@ -60,17 +60,12 @@ static forceinline char *spop_conn_show_flags(char *buf, size_t len, const char /**** SPOP stream flags (32 bit), in spop_strm->flags ****/ #define SPOP_SF_NONE 0x00000000 #define SPOP_SF_ACK_RCVD 0x00000001 /* ACK freme received */ -//#define SPOP_SF_ES_SENT 0x00000002 /* end-of-stream sent */ -//#define SPOP_SF_EP_SENT 0x00000004 /* end-of-param sent */ -//#define SPOP_SF_DISCON_SENT 0x00000008 /* disconnect sent */ /* Stream flags indicating the reason the stream is blocked */ #define SPOP_SF_BLK_MBUSY 0x00000010 /* blocked waiting for mux access (transient) */ #define SPOP_SF_BLK_MROOM 0x00000020 /* blocked waiting for room in the mux */ #define SPOP_SF_BLK_ANY 0x00000030 /* any of the reasons above */ -//#define SPOP_SF_BEGIN_SENT 0x00000100 /* a BEGIN_REQUEST record was sent for this stream */ -//#define SPOP_SF_OUTGOING_DATA 0x00000200 /* set whenever we've seen outgoing data */ #define SPOP_SF_NOTIFIED 0x00000400 /* a paused stream was notified to try to send again */ /* This function is used to report flags in debugging tools. Please reflect diff --git a/src/mux_spop.c b/src/mux_spop.c index a1b32fcd8..bc22eef9f 100644 --- a/src/mux_spop.c +++ b/src/mux_spop.c @@ -278,7 +278,7 @@ static const struct spop_strm *spop_closed_stream = &(const struct spop_strm){ .sd = (struct sedesc *)&closed_ep, .spop_conn = NULL, .state = SPOP_SS_CLOSED, - .flags = SPOP_SF_NONE, // TODO ? + .flags = SPOP_SF_NONE, .id = 0, }; @@ -1961,14 +1961,6 @@ static int spop_conn_handle_ack(struct spop_conn *spop_conn, struct spop_strm *s /* b_del(&spop_conn->dbuf, sent); */ spop_conn->dfl -= sent; - // TODO: may happen or not ? - /* /\* call the upper layers to process the frame, then let the upper layer */ - /* * notify the stream about any change. */ - /* *\/ */ - /* if (!spop_strm_sc(spop_strm)) { */ - /* /\* The upper layer has already closed *\/ */ - - /* } */ if (spop_strm->state == SPOP_SS_OPEN) spop_strm->state = SPOP_SS_HREM; else @@ -2612,8 +2604,7 @@ static int spop_process(struct spop_conn *spop_conn) } if ((spop_conn->flags & SPOP_CF_ERROR) || spop_conn_read0_pending(spop_conn) || - spop_conn->state == SPOP_CS_CLOSED || (spop_conn->flags & SPOP_CF_DISCO_FAILED) /* || */ - /* TODO: no sure ? eb_is_empty(&spop_conn->streams_by_id) */) { + spop_conn->state == SPOP_CS_CLOSED || (spop_conn->flags & SPOP_CF_DISCO_FAILED)) { spop_wake_some_streams(spop_conn, 0); if (eb_is_empty(&spop_conn->streams_by_id)) { @@ -2910,7 +2901,7 @@ static void spop_detach(struct sedesc *sd) /* this stream may be blocked waiting for some data to leave, so orphan * it in this case. */ - if (!(spop_conn->flags & (SPOP_CF_ERR_PENDING|SPOP_CF_ERROR)) && // FIXME: Be sure for ERR_PENDING + if (!(spop_conn->flags & (SPOP_CF_ERR_PENDING|SPOP_CF_ERROR)) && (spop_conn->state != SPOP_CS_CLOSED) && (spop_strm->flags & (SPOP_SF_BLK_MBUSY|SPOP_SF_BLK_MROOM)) && spop_strm->subs) { @@ -3257,7 +3248,7 @@ static size_t spop_rcv_buf(struct stconn *sc, struct buffer *buf, size_t count, } } - if (ret && spop_conn->dsi == spop_strm->id) { // TODO must match the frame id too !!!! + if (ret && spop_conn->dsi == spop_strm->id) { /* demux is blocking on this stream's buffer */ spop_conn->flags &= ~SPOP_CF_DEM_SFULL; spop_conn_restart_reading(spop_conn, 1);