quic: removing quicly_send call from quic_accept_connection 54/23654/4
authorMathiasRaoul <mathias.raoul@gmail.com>
Wed, 27 Nov 2019 14:44:57 +0000 (14:44 +0000)
committerDave Wallace <dwallacelf@gmail.com>
Tue, 10 Dec 2019 14:44:44 +0000 (14:44 +0000)
Type: fix

Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com>
Change-Id: I429b50b88c8e029b06854c7433d0bc77619e98a3

src/plugins/quic/quic.c

index f51881e..54a2d90 100644 (file)
@@ -1854,9 +1854,12 @@ quic_accept_connection (u32 ctx_index, quic_rx_packet_ctx_t * pctx)
       quic_proto_on_close (ctx_index, thread_index);
       return rv;
     }
-  ctx->conn_state = QUIC_CONN_STATE_HANDSHAKE;
 
-  return quic_send_packets (ctx);
+  ctx->conn_state = QUIC_CONN_STATE_READY;
+  pctx->ctx_index = ctx_index;
+  pctx->thread_index = thread_index;
+
+  return 0;
 }
 
 static int
@@ -2039,13 +2042,22 @@ rx_start:
     }
   for (i = 0; i < max_packets; i++)
     {
-      if (packets_ctx[i].ptype != QUIC_PACKET_TYPE_RECEIVE)
-       continue;
-      ctx = quic_ctx_get (packets_ctx[i].ctx_index,
-                         packets_ctx[i].thread_index);
-      quic_check_quic_session_connected (ctx);
-      ctx = quic_ctx_get (packets_ctx[i].ctx_index,
-                         packets_ctx[i].thread_index);
+      switch (packets_ctx[i].ptype)
+       {
+       case QUIC_PACKET_TYPE_RECEIVE:
+         ctx = quic_ctx_get (packets_ctx[i].ctx_index,
+                             packets_ctx[i].thread_index);
+         quic_check_quic_session_connected (ctx);
+         ctx = quic_ctx_get (packets_ctx[i].ctx_index,
+                             packets_ctx[i].thread_index);
+         break;
+       case QUIC_PACKET_TYPE_ACCEPT:
+         ctx = quic_ctx_get (packets_ctx[i].ctx_index,
+                             packets_ctx[i].thread_index);
+         break;
+       default:
+         continue;
+       }
       quic_send_packets (ctx);
     }