/* Start sending the actual data */
hc->req_state = HTTP_REQ_STATE_SEND_MORE_DATA;
+ ASSERT (sp->max_burst_size >= offset);
+ sp->max_burst_size -= offset;
+
return 1;
error:
session_t *ts;
int sent = 0;
+ max_send = clib_min (max_send, sp->max_burst_size);
ts = session_get_from_handle (hc->h_tc_session_handle);
if ((seg = http_buffer_get_segs (hb, max_send, &n_segs)))
sent = svm_fifo_enqueue_segments (ts->tx_fifo, seg, n_segs,
{
/* Ask scheduler to notify app of deq event if needed */
sp->bytes_dequeued += http_buffer_drain (hb, sent);
+ sp->max_burst_size -= sent;
}
/* Not finished sending all data */
http_app_tx_callback (void *session, transport_send_params_t *sp)
{
session_t *as = (session_t *) session;
+ u32 max_burst_sz, sent;
http_conn_t *hc;
hc = http_conn_get_w_thread (as->connection_index, as->thread_index);
return 0;
}
+ max_burst_sz = sp->max_burst_size * TRANSPORT_PACER_MIN_MSS;
+ sp->max_burst_size = max_burst_sz;
+
http_req_run_state_machine (hc, sp);
if (hc->state == HTTP_CONN_STATE_CLOSED)
if (!svm_fifo_max_dequeue_cons (as->rx_fifo))
http_disconnect_transport (hc);
}
- return 0;
+
+ sent = max_burst_sz - sp->max_burst_size;
+
+ return sent > 0 ? clib_max (sent / TRANSPORT_PACER_MIN_MSS, 1) : 0;
}
static void