diff src/event/ngx_event_quic_transport.c @ 8344:e0abe17a2878 quic

Removed source/destination swap from the function creating header. The function now creates a header according to fileds provided in the "pkt" argument without applying any logic regarding sending side.
author Vladimir Homutov <vl@nginx.com>
date Mon, 20 Apr 2020 12:12:17 +0300
parents 76e8ec502c69
children dd84c9cef75b
line wrap: on
line diff
--- a/src/event/ngx_event_quic_transport.c	Fri Apr 17 12:01:45 2020 +0300
+++ b/src/event/ngx_event_quic_transport.c	Mon Apr 20 12:12:17 2020 +0300
@@ -365,12 +365,12 @@
 
     p = ngx_quic_write_uint32(p, NGX_QUIC_VERSION);
 
+    *p++ = pkt->dcid.len;
+    p = ngx_cpymem(p, pkt->dcid.data, pkt->dcid.len);
+
     *p++ = pkt->scid.len;
     p = ngx_cpymem(p, pkt->scid.data, pkt->scid.len);
 
-    *p++ = pkt->dcid.len;
-    p = ngx_cpymem(p, pkt->dcid.data, pkt->dcid.len);
-
     if (pkt->level == ssl_encryption_initial) {
         ngx_quic_build_int(&p, pkt->token.len);
     }
@@ -408,7 +408,7 @@
 
     *p++ = pkt->flags;
 
-    p = ngx_cpymem(p, pkt->scid.data, pkt->scid.len);
+    p = ngx_cpymem(p, pkt->dcid.data, pkt->dcid.len);
 
     *pnp = p;