From: Florin Coras Date: Tue, 25 Jan 2022 07:30:08 +0000 (-0800) Subject: http: fix rescheduling when transport fifo full X-Git-Tag: v22.10-rc0~467 X-Git-Url: https://gerrit.fd.io/r/gitweb?a=commitdiff_plain;h=340bd8f1efdaaf40d87553a46314c51aba074eb3;p=vpp.git http: fix rescheduling when transport fifo full Type: fix Signed-off-by: Florin Coras Change-Id: I5ae1039fd614865154bae94150371e42f3e6fd2a --- diff --git a/src/plugins/http/http.c b/src/plugins/http/http.c index 6d08e1dd23e..0868027982e 100644 --- a/src/plugins/http/http.c +++ b/src/plugins/http/http.c @@ -578,7 +578,7 @@ state_send_more_data (http_conn_t *hc, transport_send_params_t *sp) /* Not finished sending all data */ if (!http_buffer_is_drained (hb)) { - if (svm_fifo_set_event (ts->tx_fifo)) + if (sent && svm_fifo_set_event (ts->tx_fifo)) session_send_io_evt_to_thread (ts->tx_fifo, SESSION_IO_EVT_TX); if (svm_fifo_max_enqueue (ts->tx_fifo) < 16 << 10) @@ -592,7 +592,7 @@ state_send_more_data (http_conn_t *hc, transport_send_params_t *sp) } else { - if (svm_fifo_set_event (ts->tx_fifo)) + if (sent && svm_fifo_set_event (ts->tx_fifo)) session_send_io_evt_to_thread (ts->tx_fifo, SESSION_IO_EVT_TX_FLUSH); /* Finished transaction, back to HTTP_REQ_STATE_WAIT_METHOD */ @@ -657,7 +657,11 @@ http_ts_rx_callback (session_t *ts) int http_ts_builtin_tx_callback (session_t *ts) { - clib_warning ("called"); + http_conn_t *hc; + + hc = http_conn_get_w_thread (ts->opaque, ts->thread_index); + transport_connection_reschedule (&hc->connection); + return 0; } @@ -858,6 +862,8 @@ http_app_tx_callback (void *session, transport_send_params_t *sp) session_t *as = (session_t *) session; http_conn_t *hc; + sp->flags = 0; + hc = http_conn_get_w_thread (as->connection_index, as->thread_index); if (hc->req_state < HTTP_REQ_STATE_WAIT_APP) {