[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 144/220: quiche: register debug callback once and e
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 144/220: quiche: register debug callback once and earlier |
Date: |
Thu, 12 Sep 2019 17:28:24 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit e54affa82cba9d1a2113c3867f4b8d7855df9200
Author: Alessandro Ghedini <address@hidden>
AuthorDate: Sat Aug 17 15:04:33 2019 +0100
quiche: register debug callback once and earlier
The quiche debug callback is global and can only be initialized once, so
make sure we don't do it multiple times (e.g. if multiple requests are
executed).
In addition this initializes the callback before the connection is
created, so we get logs for the handshake as well.
Closes #4236
---
lib/vquic/quiche.c | 30 ++++++++++++++++++------------
1 file changed, 18 insertions(+), 12 deletions(-)
diff --git a/lib/vquic/quiche.c b/lib/vquic/quiche.c
index 0ac848134..b84cc4779 100644
--- a/lib/vquic/quiche.c
+++ b/lib/vquic/quiche.c
@@ -137,6 +137,14 @@ static const struct Curl_handler Curl_handler_h3_quiche = {
PROTOPT_SSL | PROTOPT_STREAM /* flags */
};
+#ifdef DEBUG_QUICHE
+static void quiche_debug_log(const char *line, void *argp)
+{
+ (void)argp;
+ fprintf(stderr, "%s\n", line);
+}
+#endif
+
CURLcode Curl_quic_connect(struct connectdata *conn, curl_socket_t sockfd,
int sockindex,
const struct sockaddr *addr, socklen_t addrlen)
@@ -144,6 +152,16 @@ CURLcode Curl_quic_connect(struct connectdata *conn,
curl_socket_t sockfd,
CURLcode result;
struct quicsocket *qs = &conn->hequic[sockindex];
struct Curl_easy *data = conn->data;
+
+#ifdef DEBUG_QUICHE
+ /* initialize debug log callback only once */
+ static int debug_log_init = 0;
+ if(!debug_log_init) {
+ quiche_enable_debug_logging(quiche_debug_log, NULL);
+ debug_log_init = 1;
+ }
+#endif
+
(void)addr;
(void)addrlen;
@@ -505,14 +523,6 @@ int Curl_quic_ver(char *p, size_t len)
return msnprintf(p, len, " quiche/%s", quiche_version());
}
-#ifdef DEBUG_QUICHE
-static void debug_log(const char *line, void *argp)
-{
- (void)argp;
- fprintf(stderr, "%s\n", line);
-}
-#endif
-
/* Index where :authority header field will appear in request header
field list. */
#define AUTHORITY_DST_IDX 3
@@ -534,10 +544,6 @@ static CURLcode http_request(struct connectdata *conn,
const void *mem,
CURLcode result = CURLE_OK;
struct Curl_easy *data = conn->data;
-#ifdef DEBUG_QUICHE
- quiche_enable_debug_logging(debug_log, NULL);
-#endif
-
stream->h3req = TRUE; /* senf off! */
/* Calculate number of headers contained in [mem, mem + len). Assumes a
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [gnurl] 90/220: http3: fix the HTTP/3 in the request, make alt-svc set right versions, (continued)
- [GNUnet-SVN] [gnurl] 90/220: http3: fix the HTTP/3 in the request, make alt-svc set right versions, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 88/220: CURLOPT_HTTP_VERSION: seting this to 3 forces HTTP/3 use directly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 104/220: nghttp3: required when ngtcp2 is used for QUIC, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 106/220: ngtcp2: send HTTP/3 request with nghttp3, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 107/220: CURLOPT_READFUNCTION.3: provide inline example, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 111/220: ngtcp2: initial h3 request work, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 128/220: ngtcp2: don't reinitialize SSL on Retry, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 124/220: ngtcp2: do QUIC connections happy-eyeballs friendly, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 135/220: tests: Replace outdated test case numbering documentation, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 133/220: configure: use -lquiche to link to quiche, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 144/220: quiche: register debug callback once and earlier,
gnunet <=
- [GNUnet-SVN] [gnurl] 138/220: RELEASE-NOTES: synced, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 140/220: vssh: create directory for SSH backend code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 145/220: ngtcp2: move the h3 initing to immediately after the rx key, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 130/220: ngtcp2: deal with stream close, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 131/220: ngtcp2: add missing nghttp3_conn_add_write_offset call, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 132/220: ngtcp2: provide the callbacks as a static struct, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 85/220: curl: make use of CURLINFO_RETRY_AFTER when retrying, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 89/220: alt-svc: send Alt-Used: in redirected requests, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 141/220: vssh: move ssh init/cleanup functions into backend code, gnunet, 2019/09/12
- [GNUnet-SVN] [gnurl] 114/220: CURLOPT_ALTSVC_CTRL.3: remove CURLALTSVC_ALTUSED, gnunet, 2019/09/12