aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2022-01-24 23:30:08 -0800
committerFlorin Coras <florin.coras@gmail.com>2022-01-25 07:20:15 +0000
commit340bd8f1efdaaf40d87553a46314c51aba074eb3 (patch)
tree6e278d02065837aec850fc875a54ddf45e920759 /src
parentffd9057493ba75d157d8fd316f4978b64a6efb30 (diff)
http: fix rescheduling when transport fifo full
Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5ae1039fd614865154bae94150371e42f3e6fd2a
Diffstat (limited to 'src')
-rw-r--r--src/plugins/http/http.c12
1 files changed, 9 insertions, 3 deletions
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)
{