mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
REORG: quic: Move qc_notify_send() to quic_conn
Move qc_notify_send() from quic_tx.c to quic_conn.c. Note that it was already exported from both quic_conn.h and quic_tx.h. Modify this latter header to fix the duplication.
This commit is contained in:
parent
b39362070d
commit
714d1096bc
@ -37,7 +37,6 @@ int qc_prep_hpkts(struct quic_conn *qc, struct buffer *buf, struct list *qels);
|
|||||||
int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx);
|
int qc_send_ppkts(struct buffer *buf, struct ssl_sock_ctx *ctx);
|
||||||
int qc_send_app_pkts(struct quic_conn *qc, struct list *frms);
|
int qc_send_app_pkts(struct quic_conn *qc, struct list *frms);
|
||||||
int qc_dgrams_retransmit(struct quic_conn *qc);
|
int qc_dgrams_retransmit(struct quic_conn *qc);
|
||||||
int qc_notify_send(struct quic_conn *qc);
|
|
||||||
void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
|
void qc_prep_hdshk_fast_retrans(struct quic_conn *qc,
|
||||||
struct list *ifrms, struct list *hfrms);
|
struct list *ifrms, struct list *hfrms);
|
||||||
int send_retry(int fd, struct sockaddr_storage *addr,
|
int send_retry(int fd, struct sockaddr_storage *addr,
|
||||||
|
@ -1725,6 +1725,35 @@ int qc_check_dcid(struct quic_conn *qc, unsigned char *dcid, size_t dcid_len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Wake-up upper layer for sending if all conditions are met :
|
||||||
|
* - room in congestion window or probe packet to sent
|
||||||
|
* - socket FD ready to sent or listener socket used
|
||||||
|
*
|
||||||
|
* Returns 1 if upper layer has been woken up else 0.
|
||||||
|
*/
|
||||||
|
int qc_notify_send(struct quic_conn *qc)
|
||||||
|
{
|
||||||
|
const struct quic_pktns *pktns = qc->apktns;
|
||||||
|
|
||||||
|
if (qc->subs && qc->subs->events & SUB_RETRY_SEND) {
|
||||||
|
/* RFC 9002 7.5. Probe Timeout
|
||||||
|
*
|
||||||
|
* Probe packets MUST NOT be blocked by the congestion controller.
|
||||||
|
*/
|
||||||
|
if ((quic_cc_path_prep_data(qc->path) || pktns->tx.pto_probe) &&
|
||||||
|
(!qc_test_fd(qc) || !fd_send_active(qc->fd))) {
|
||||||
|
tasklet_wakeup(qc->subs->tasklet);
|
||||||
|
qc->subs->events &= ~SUB_RETRY_SEND;
|
||||||
|
if (!qc->subs->events)
|
||||||
|
qc->subs = NULL;
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* Notify upper layer of a fatal error which forces to close the connection. */
|
/* Notify upper layer of a fatal error which forces to close the connection. */
|
||||||
void qc_notify_err(struct quic_conn *qc)
|
void qc_notify_err(struct quic_conn *qc)
|
||||||
{
|
{
|
||||||
|
@ -2581,36 +2581,6 @@ static struct quic_tx_packet *qc_build_pkt(unsigned char **pos,
|
|||||||
free_quic_tx_packet(qc, pkt);
|
free_quic_tx_packet(qc, pkt);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wake-up upper layer for sending if all conditions are met :
|
|
||||||
* - room in congestion window or probe packet to sent
|
|
||||||
* - socket FD ready to sent or listener socket used
|
|
||||||
*
|
|
||||||
* Returns 1 if upper layer has been woken up else 0.
|
|
||||||
*/
|
|
||||||
int qc_notify_send(struct quic_conn *qc)
|
|
||||||
{
|
|
||||||
const struct quic_pktns *pktns = qc->apktns;
|
|
||||||
|
|
||||||
if (qc->subs && qc->subs->events & SUB_RETRY_SEND) {
|
|
||||||
/* RFC 9002 7.5. Probe Timeout
|
|
||||||
*
|
|
||||||
* Probe packets MUST NOT be blocked by the congestion controller.
|
|
||||||
*/
|
|
||||||
if ((quic_cc_path_prep_data(qc->path) || pktns->tx.pto_probe) &&
|
|
||||||
(!qc_test_fd(qc) || !fd_send_active(qc->fd))) {
|
|
||||||
tasklet_wakeup(qc->subs->tasklet);
|
|
||||||
qc->subs->events &= ~SUB_RETRY_SEND;
|
|
||||||
if (!qc->subs->events)
|
|
||||||
qc->subs = NULL;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local variables:
|
* Local variables:
|
||||||
* c-indent-level: 8
|
* c-indent-level: 8
|
||||||
|
Loading…
Reference in New Issue
Block a user