comparison src/http/ngx_http_request.c @ 8170:53a5cdbe500c quic

QUIC add_handshake_data callback, varint routines.
author Sergey Kandaurov <pluknet@nginx.com>
date Fri, 28 Feb 2020 13:09:51 +0300
parents bd006bd520a9
children 4daf03d2bd0a
comparison
equal deleted inserted replaced
8169:bd006bd520a9 8170:53a5cdbe500c
655 } 655 }
656 656
657 657
658 #if (NGX_HTTP_SSL) 658 #if (NGX_HTTP_SSL)
659 659
660 static uint64_t
661 ngx_quic_parse_int(u_char **pos)
662 {
663 u_char *p;
664 uint64_t value;
665 ngx_uint_t len;
666
667 p = *pos;
668 len = 1 << ((*p & 0xc0) >> 6);
669 value = *p++ & 0x3f;
670
671 while (--len) {
672 value = (value << 8) + *p++;
673 }
674
675 *pos = p;
676 return value;
677 }
678
679
680 static uint64_t
681 ngx_quic_parse_pn(u_char **pos, ngx_int_t len, u_char *mask)
682 {
683 u_char *p;
684 uint64_t value;
685
686 p = *pos;
687 value = *p++ ^ *mask++;
688
689 while (--len) {
690 value = (value << 8) + (*p++ ^ *mask++);
691 }
692
693 *pos = p;
694 return value;
695 }
696
697
698 static void 660 static void
699 ngx_http_quic_handshake(ngx_event_t *rev) 661 ngx_http_quic_handshake(ngx_event_t *rev)
700 { 662 {
701 int n, sslerr; 663 int n, sslerr;
702 #if (NGX_DEBUG) 664 #if (NGX_DEBUG)
1208 1170
1209 #if (NGX_DEBUG) 1171 #if (NGX_DEBUG)
1210 if (c->log->log_level & NGX_LOG_DEBUG_EVENT) { 1172 if (c->log->log_level & NGX_LOG_DEBUG_EVENT) {
1211 m = ngx_hex_dump(buf, cleartext, ngx_min(cleartext_len, 256)) - buf; 1173 m = ngx_hex_dump(buf, cleartext, ngx_min(cleartext_len, 256)) - buf;
1212 ngx_log_debug4(NGX_LOG_DEBUG_HTTP, rev->log, 0, 1174 ngx_log_debug4(NGX_LOG_DEBUG_HTTP, rev->log, 0,
1213 "quic packet: %*s%s, len: %uz", 1175 "quic packet payload: %*s%s, len: %uz",
1214 m, buf, m < 512 ? "" : "...", cleartext_len); 1176 m, buf, m < 512 ? "" : "...", cleartext_len);
1215 } 1177 }
1216 #endif 1178 #endif
1217 1179
1218 sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module); 1180 sscf = ngx_http_get_module_srv_conf(hc->conf_ctx, ngx_http_ssl_module);