[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 69/173: http: print correct HTTP string in verbose
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 69/173: http: print correct HTTP string in verbose output when using HTTP/2 |
Date: |
Fri, 24 Feb 2017 14:01:31 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.53.1
in repository gnurl.
commit 1ad1a0d1861699a95d4edb78571470669cc7b2b5
Author: Alessandro Ghedini <address@hidden>
AuthorDate: Fri Jan 13 22:28:41 2017 +0000
http: print correct HTTP string in verbose output when using HTTP/2
Before:
```
% src/curl https://sigsegv.ninja/ -v --http2
...
> GET / HTTP/1.1
> Host: sigsegv.ninja
> User-Agent: curl/7.52.2-DEV
> Accept: */*
>
...
```
After:
```
% src/curl https://sigsegv.ninja/ -v --http2
...
> GET / HTTP/2
> Host: sigsegv.ninja
> User-Agent: curl/7.52.2-DEV
> Accept: */*
>
```
---
lib/http.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/lib/http.c b/lib/http.c
index dfa26a80e..fdaecafdc 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -1509,6 +1509,20 @@ static bool use_http_1_1plus(const struct Curl_easy
*data,
(data->set.httpversion >= CURL_HTTP_VERSION_1_1));
}
+static const char *get_http_string(const struct Curl_easy *data,
+ const struct connectdata *conn)
+{
+#ifdef USE_NGHTTP2
+ if(conn->proto.httpc.h2)
+ return "2";
+#endif
+
+ if(use_http_1_1plus(data, conn))
+ return "1.1";
+
+ return "1.0";
+}
+
/* check and possibly add an Expect: header */
static CURLcode expect100(struct Curl_easy *data,
struct connectdata *conn,
@@ -2223,9 +2237,7 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
}
}
- /* Use 1.1 unless the user specifically asked for 1.0 or the server only
- supports 1.0 */
- httpstring= use_http_1_1plus(data, conn)?"1.1":"1.0";
+ httpstring = get_http_string(data, conn);
/* initialize a dynamic send-buffer */
req_buffer = Curl_add_buffer_init();
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 13/173: docs/ciphers: link to our own new page about ciphers, (continued)
- [GNUnet-SVN] [gnurl] 13/173: docs/ciphers: link to our own new page about ciphers, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 31/173: wolfssl: display negotiated SSL version and cipher, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 28/173: TheArtOfHttpScripting: grammar, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 22/173: tool_operate: Fix --remote-time incorrect times on Windows, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 19/173: cmake: use crypt32.lib when building with OpenSSL on windows, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 26/173: docs/libcurl: TCP_KEEPALIVE start and interval default to 60, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 20/173: curl_formadd.3: CURLFORM_CONTENTSLENGTH not needed when chunked, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 53/173: IDN: Fix compile time detection of linidn2 TR46, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 58/173: curl: reset the easy handle at --next, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 42/173: http2_send: avoid unsigned integer wrap around, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 69/173: http: print correct HTTP string in verbose output when using HTTP/2,
gnunet <=
- [GNUnet-SVN] [gnurl] 43/173: smtp: Fix STARTTLS denied error message, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 36/173: lib506: fix build for Open Watcom, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 38/173: examples: make the C++ examples follow our code style too, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 49/173: IDN: Use TR46 'transitional' for toASCII translations, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 62/173: RELEASE-NOTES: synced with a7c73ae309c, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 25/173: curl.h: CURLE_FUNCTION_NOT_FOUND is no longer in use, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 41/173: cmake: Fix passing _WINSOCKAPI_ macro to compiler, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 54/173: IDN: revert use of the transitional option, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 52/173: url: --noproxy option overrides NO_PROXY environment variable, gnunet, 2017/02/24
- [GNUnet-SVN] [gnurl] 46/173: url: Fix parsing for when 'file' is the default protocol, gnunet, 2017/02/24