gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 79/220: quiche: make use of the connection timeout


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 79/220: quiche: make use of the connection timeout API properly
Date: Thu, 12 Sep 2019 17:27:19 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 1f145b02d95f42ffba23fa6ea6a867aeba3cbdc1
Author: Daniel Stenberg <address@hidden>
AuthorDate: Wed Aug 7 12:49:27 2019 +0200

    quiche: make use of the connection timeout API properly
---
 lib/urldata.h      |  1 +
 lib/vquic/quiche.c | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/lib/urldata.h b/lib/urldata.h
index b3b1263c6..eabb1b5c7 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1227,6 +1227,7 @@ typedef enum {
   EXPIRE_SPEEDCHECK,
   EXPIRE_TIMEOUT,
   EXPIRE_TOOFAST,
+  EXPIRE_QUIC,
   EXPIRE_LAST /* not an actual timer, used as a marker only */
 } expire_id;
 
diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c
index 67c2b1b42..c4e7b03fe 100644
--- a/lib/vquic/quiche.c
+++ b/lib/vquic/quiche.c
@@ -209,6 +209,9 @@ static CURLcode process_ingress(struct connectdata *conn, 
int sockfd)
   uint8_t *buf = (uint8_t *)data->state.buffer;
   size_t bufsize = data->set.buffer_size;
 
+  /* in case the timeout expired */
+  quiche_conn_on_timeout(qs->conn);
+
   do {
     recvd = recv(sockfd, buf, bufsize, 0);
     if((recvd < 0) && ((errno == EAGAIN) || (errno == EWOULDBLOCK)))
@@ -241,6 +244,7 @@ static CURLcode flush_egress(struct connectdata *conn, int 
sockfd)
   ssize_t sent;
   struct quicsocket *qs = &conn->quic;
   static uint8_t out[1200];
+  int64_t timeout_ns;
 
   do {
     sent = quiche_conn_send(qs->conn, out, sizeof(out));
@@ -260,6 +264,12 @@ static CURLcode flush_egress(struct connectdata *conn, int 
sockfd)
     }
   } while(1);
 
+  /* time until the next timeout event, as nanoseconds. */
+  timeout_ns = quiche_conn_timeout_as_nanos(qs->conn);
+  if(timeout_ns)
+    /* expire uses milliseconds */
+    Curl_expire(conn->data, (timeout_ns + 999999) / 1000000, EXPIRE_QUIC);
+
   return CURLE_OK;
 }
 

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]