nghttpx: Compile without UDP_SEGMENT
This commit is contained in:
parent
7de71b29a0
commit
102d960106
|
@ -638,6 +638,7 @@ int Http3Upstream::write_streams() {
|
|||
|
||||
bufpos += nwrite;
|
||||
|
||||
#ifdef UDP_SEGMENT
|
||||
if (pktcnt == 0) {
|
||||
ngtcp2_path_copy(&prev_ps.path, &ps.path);
|
||||
} else if (!ngtcp2_path_eq(&prev_ps.path, &ps.path)) {
|
||||
|
@ -674,6 +675,23 @@ int Http3Upstream::write_streams() {
|
|||
|
||||
return 0;
|
||||
}
|
||||
#else // !UDP_SEGMENT
|
||||
quic_send_packet(static_cast<UpstreamAddr *>(ps.path.user_data),
|
||||
ps.path.remote.addr, ps.path.remote.addrlen,
|
||||
ps.path.local.addr, ps.path.local.addrlen, buf.data(),
|
||||
bufpos - buf.data(), 0);
|
||||
|
||||
if (++pktcnt == max_pktcnt) {
|
||||
ngtcp2_conn_update_pkt_tx_time(conn_, ts);
|
||||
reset_idle_timer();
|
||||
|
||||
handler_->signal_write();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
bufpos = buf.data();
|
||||
#endif // !UDP_SEGMENT
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -210,8 +210,11 @@ int quic_send_packet(const UpstreamAddr *faddr, const sockaddr *remote_sa,
|
|||
msg.msg_iov = &msg_iov;
|
||||
msg.msg_iovlen = 1;
|
||||
|
||||
uint8_t
|
||||
msg_ctrl[CMSG_SPACE(sizeof(uint16_t)) + CMSG_SPACE(sizeof(in6_pktinfo))];
|
||||
uint8_t msg_ctrl[
|
||||
#ifdef UDP_SEGMENT
|
||||
CMSG_SPACE(sizeof(uint16_t)) +
|
||||
#endif // UDP_SEGMENT
|
||||
CMSG_SPACE(sizeof(in6_pktinfo))];
|
||||
|
||||
memset(msg_ctrl, 0, sizeof(msg_ctrl));
|
||||
|
||||
|
@ -251,6 +254,7 @@ int quic_send_packet(const UpstreamAddr *faddr, const sockaddr *remote_sa,
|
|||
assert(0);
|
||||
}
|
||||
|
||||
#ifdef UDP_SEGMENT
|
||||
if (gso_size && datalen > gso_size) {
|
||||
controllen += CMSG_SPACE(sizeof(uint16_t));
|
||||
cm = CMSG_NXTHDR(&msg, cm);
|
||||
|
@ -259,6 +263,7 @@ int quic_send_packet(const UpstreamAddr *faddr, const sockaddr *remote_sa,
|
|||
cm->cmsg_len = CMSG_LEN(sizeof(uint16_t));
|
||||
*(reinterpret_cast<uint16_t *>(CMSG_DATA(cm))) = gso_size;
|
||||
}
|
||||
#endif // UDP_SEGMENT
|
||||
|
||||
msg.msg_controllen = controllen;
|
||||
|
||||
|
|
Loading…
Reference in New Issue