diff options
author | Werner Koch <wk@gnupg.org> | 2015-10-26 21:04:54 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2015-10-26 21:04:54 +0100 |
commit | dda9c84bc67326a6d2bef1e5c45b5de8b67eeb40 (patch) | |
tree | 4770ca78c3e346d0062ebeadd741f594a8969bc0 | |
parent | 4061ac57ca84a1e0ed779096897a160d49b50c03 (diff) | |
download | libassuan-dda9c84bc67326a6d2bef1e5c45b5de8b67eeb40.tar.gz |
Tests: Cope with broken HTTP servers.
* tests/socks5.c (main): Use GET instead of HEAD
-rw-r--r-- | tests/socks5.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/socks5.c b/tests/socks5.c index 7aa2b71..68659fc 100644 --- a/tests/socks5.c +++ b/tests/socks5.c @@ -69,6 +69,7 @@ main (int argc, char **argv) assuan_fd_t sock = ASSUAN_INVALID_FD; estream_t infp, outfp; int c; + int lf_seen; if (argc) { @@ -279,13 +280,22 @@ main (int argc, char **argv) log_fatal ("opening outbound stream failed: %s\n", gpg_strerror (err)); } - es_fputs ("HEAD / HTTP/1.0\r\n\r\n", outfp); + es_fputs ("GET / HTTP/1.0\r\n\r\n", outfp); es_fflush (outfp); + lf_seen = 0; while ((c = es_fgetc (infp)) != EOF) { + if (c == '\r') + continue; putchar (c); if (c == '\n') - break; + { + if (lf_seen) + break; + lf_seen = 1; + } + else + lf_seen = 0; } es_fclose (infp); es_fclose (outfp); |