session: fix allocation of proxy fifos
[vpp.git] / src / plugins / quic / quic.c
index 3dab5eb..f94a0c8 100644 (file)
@@ -784,12 +784,10 @@ quic_on_stream_destroy (quicly_stream_t * stream, int err)
   quic_stream_data_t *stream_data = (quic_stream_data_t *) stream->data;
   quic_ctx_t *sctx = quic_ctx_get (stream_data->ctx_id,
                                   stream_data->thread_index);
-  session_t *stream_session = session_get (sctx->c_s_index,
-                                          sctx->c_thread_index);
   QUIC_DBG (2, "DESTROYED_STREAM: session 0x%lx (%U)",
            session_handle (stream_session), quic_format_err, err);
 
-  stream_session->session_state = SESSION_STATE_CLOSED;
+  session_transport_closing_notify (&sctx->connection);
   session_transport_delete_notify (&sctx->connection);
 
   quic_increment_counter (QUIC_ERROR_CLOSED_STREAM, 1);
@@ -832,7 +830,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src,
                 size_t len)
 {
   QUIC_DBG (3, "received data: %lu bytes, offset %lu", len, off);
-  u32 max_enq, rv;
+  u32 max_enq;
   quic_ctx_t *sctx;
   session_t *stream_session;
   app_worker_t *app_wrk;
@@ -897,10 +895,7 @@ quic_on_receive (quicly_stream_t * stream, size_t off, const void *src,
       app_wrk = app_worker_get_if_valid (stream_session->app_wrk_index);
       if (PREDICT_TRUE (app_wrk != 0))
        {
-         rv = app_worker_lock_and_send_event (app_wrk, stream_session,
-                                              SESSION_IO_EVT_RX);
-         if (rv)
-           QUIC_ERR ("Failed to ping app for RX");
+         app_worker_rx_notify (app_wrk, stream_session);
        }
       quic_ack_rx_data (stream_session);
     }
@@ -1158,9 +1153,8 @@ quic_update_timer (quic_ctx_t * ctx)
          quic_session = session_get (ctx->c_s_index, ctx->c_thread_index);
          if (svm_fifo_set_event (quic_session->tx_fifo))
            {
-             rv = session_send_io_evt_to_thread_custom (quic_session,
-                                                        quic_session->thread_index,
-                                                        SESSION_IO_EVT_BUILTIN_TX);
+             rv = session_send_io_evt_to_thread_custom (
+               quic_session, quic_session->thread_index, SESSION_IO_EVT_TX);
              if (PREDICT_FALSE (rv))
                QUIC_ERR ("Failed to enqueue builtin_tx %d", rv);
            }
@@ -1296,6 +1290,7 @@ quic_connect_stream (session_t * quic_session, session_endpoint_cfg_t * sep)
   stream_data->app_rx_data_len = 0;
   stream_data->app_tx_data_len = 0;
   stream_session->session_state = SESSION_STATE_READY;
+  stream_session->opaque = sep->opaque;
 
   /* For now we only reset streams. Cleanup will be triggered by timers */
   if ((rv = app_worker_init_connected (app_wrk, stream_session)))