Fix some issues of HTTP/3 in nginx-1.25.2.

This commit is contained in:
fengbojiang 2023-09-05 20:38:05 +08:00
parent 51dc2a507f
commit 33903b65de
3 changed files with 32 additions and 16 deletions

View File

@ -247,16 +247,16 @@ ngx_feature_test="union bpf_attr attr = { 0 };
attr.map_type = BPF_MAP_TYPE_SOCKHASH;
syscall(__NR_bpf, 0, &attr, 0);"
. auto/feature
if [ $ngx_found = yes ]; then
CORE_SRCS="$CORE_SRCS src/core/ngx_bpf.c"
CORE_DEPS="$CORE_DEPS src/core/ngx_bpf.h"
if [ $QUIC_BPF != NONE ]; then
QUIC_BPF=YES
fi
fi
#. auto/feature
#
#if [ $ngx_found = yes ]; then
# CORE_SRCS="$CORE_SRCS src/core/ngx_bpf.c"
# CORE_DEPS="$CORE_DEPS src/core/ngx_bpf.h"
#
# if [ $QUIC_BPF != NONE ]; then
# QUIC_BPF=YES
# fi
#fi
ngx_feature="SO_COOKIE"
@ -269,11 +269,11 @@ ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(uint64_t);
uint64_t cookie;
getsockopt(0, SOL_SOCKET, SO_COOKIE, &cookie, &optlen)"
. auto/feature
if [ $ngx_found = yes ]; then
SO_COOKIE_FOUND=YES
fi
#. auto/feature
#
#if [ $ngx_found = yes ]; then
# SO_COOKIE_FOUND=YES
#fi
# UDP segmentation offloading
@ -288,7 +288,7 @@ ngx_feature_libs=
ngx_feature_test="socklen_t optlen = sizeof(int);
int val;
getsockopt(0, SOL_UDP, UDP_SEGMENT, &val, &optlen)"
. auto/feature
#. auto/feature
CC_AUX_FLAGS="$cc_aux_flags -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64"

View File

@ -427,7 +427,11 @@ ngx_quic_send_segments(ngx_connection_t *c, u_char *buf, size_t len,
*valp = segment;
#if (NGX_HAVE_ADDRINFO_CMSG)
#if (NGX_HAVE_FSTACK)
if ((!c->listening->belong_to_host) && c->listening && c->listening->wildcard && c->local_sockaddr) {
#else
if (c->listening && c->listening->wildcard && c->local_sockaddr) {
#endif
cmsg = CMSG_NXTHDR(&msg, cmsg);
clen += ngx_set_srcaddr_cmsg(cmsg, c->local_sockaddr);
}
@ -691,7 +695,11 @@ ngx_quic_send(ngx_connection_t *c, u_char *buf, size_t len,
msg.msg_namelen = socklen;
#if (NGX_HAVE_ADDRINFO_CMSG)
#if (NGX_HAVE_FSTACK)
if ((!c->listening->belong_to_host) && c->listening && c->listening->wildcard && c->local_sockaddr) {
#else
if (c->listening && c->listening->wildcard && c->local_sockaddr) {
#endif
msg.msg_control = msg_control;
msg.msg_controllen = sizeof(msg_control);

View File

@ -396,6 +396,12 @@ ngx_sendmsg(ngx_connection_t *c, struct msghdr *msg, int flags)
#if (NGX_DEBUG)
size_t size;
ngx_uint_t i;
#if (NGX_HAVE_FSTACK)
for (i = 0, size = 0; i < (size_t) msg->msg_iovlen; i++) {
size += msg->msg_iov[i].iov_len;
}
#endif
#endif
eintr:
@ -424,9 +430,11 @@ eintr:
}
#if (NGX_DEBUG)
#if (!NGX_HAVE_FSTACK)
for (i = 0, size = 0; i < (size_t) msg->msg_iovlen; i++) {
size += msg->msg_iov[i].iov_len;
}
#endif
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"sendmsg: %z of %uz", n, size);