diff options
author | Werner Koch <[email protected]> | 2016-08-11 18:46:51 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2016-08-11 19:32:55 +0000 |
commit | 0698324cde3e0cef7eeb6cfd1640c5eefdf13698 (patch) | |
tree | 36a20b69d270381daee74443a17a4108fb407090 /dirmngr/http.c | |
parent | common: Remove compatibility code. (diff) | |
download | gnupg-0698324cde3e0cef7eeb6cfd1640c5eefdf13698.tar.gz gnupg-0698324cde3e0cef7eeb6cfd1640c5eefdf13698.zip |
common: New function string_to_u64.
* common/stringhelp.c (string_to_u64): New.
* dirmngr/http.c (longcounter_t): Remove.
(struct cookie_s): Change content_length to uint64_t.
(parse_response): Use string_to_u64.
--
Meanwhile we allow some C99 features including stdint.h. Thus we can
simplify things now.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'dirmngr/http.c')
-rw-r--r-- | dirmngr/http.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/dirmngr/http.c b/dirmngr/http.c index a512e9ad6..ac8238caf 100644 --- a/dirmngr/http.c +++ b/dirmngr/http.c @@ -130,15 +130,6 @@ "01234567890@" \ "!\"#$%&'()*+,-./:;<=>?[\\]^_{|}~" -/* A long counter type. */ -#ifdef HAVE_STRTOULL -typedef unsigned long long longcounter_t; -# define counter_strtoul(a) strtoull ((a), NULL, 10) -#else -typedef unsigned long longcounter_t; -# define counter_strtoul(a) strtoul ((a), NULL, 10) -#endif - #if HTTP_USE_NTBTLS typedef ntbtls_t tls_session_t; # define USE_TLS 1 @@ -206,7 +197,7 @@ struct cookie_s /* The remaining content length and a flag telling whether to use the content length. */ - longcounter_t content_length; + uint64_t content_length; unsigned int content_length_valid:1; }; typedef struct cookie_s *cookie_t; @@ -2170,7 +2161,7 @@ parse_response (http_t hd) if (s) { cookie->content_length_valid = 1; - cookie->content_length = counter_strtoul (s); + cookie->content_length = string_to_u64 (s); } } |