gnunet-svn
[Top][All Lists]
Advanced

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

[gnurl] 89/282: altsvc: set h3 version at a common single spot


From: gnunet
Subject: [gnurl] 89/282: altsvc: set h3 version at a common single spot
Date: Wed, 01 Apr 2020 14:29:14 +0200

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

ng0 pushed a commit to branch master
in repository gnurl.

commit d913c1e99ee1a6de372579e849af83a48a151c54
Author: Daniel Stenberg <address@hidden>
AuthorDate: Tue Feb 4 15:12:44 2020 +0100

    altsvc: set h3 version at a common single spot
    
    ... and move the #ifdefs out of the functions. Addresses the fact they
    were different before this change.
    
    Reported-by: Harry Sintonen
    Closes #4876
---
 lib/altsvc.c | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/lib/altsvc.c b/lib/altsvc.c
index 0e9a97826..93cc302bd 100644
--- a/lib/altsvc.c
+++ b/lib/altsvc.c
@@ -48,19 +48,20 @@
 #define MAX_ALTSVC_ALPNLENSTR "10"
 #define MAX_ALTSVC_ALPNLEN 10
 
+#if (defined(USE_QUICHE) || defined(USE_NGTCP2)) && !defined(UNITTESTS)
+#define H3VERSION "h3-25"
+#else
+#define H3VERSION "h3"
+#endif
+
 static enum alpnid alpn2alpnid(char *name)
 {
   if(strcasecompare(name, "h1"))
     return ALPN_h1;
   if(strcasecompare(name, "h2"))
     return ALPN_h2;
-#if (defined(USE_QUICHE) || defined(USE_NGTCP2)) && !defined(UNITTESTS)
-  if(strcasecompare(name, "h3-25"))
+  if(strcasecompare(name, H3VERSION))
     return ALPN_h3;
-#else
-  if(strcasecompare(name, "h3"))
-    return ALPN_h3;
-#endif
   return ALPN_none; /* unknown, probably rubbish input */
 }
 
@@ -73,11 +74,7 @@ const char *Curl_alpnid2str(enum alpnid id)
   case ALPN_h2:
     return "h2";
   case ALPN_h3:
-#if (defined(USE_QUICHE) || defined(USE_NGTCP2)) && !defined(UNITTESTS)
-    return "h3-24";
-#else
-    return "h3";
-#endif
+    return H3VERSION;
   default:
     return ""; /* bad */
   }

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



reply via email to

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