summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2015-10-26 21:04:54 +0100
committerWerner Koch <wk@gnupg.org>2015-10-26 21:04:54 +0100
commitdda9c84bc67326a6d2bef1e5c45b5de8b67eeb40 (patch)
tree4770ca78c3e346d0062ebeadd741f594a8969bc0
parent4061ac57ca84a1e0ed779096897a160d49b50c03 (diff)
downloadlibassuan-dda9c84bc67326a6d2bef1e5c45b5de8b67eeb40.tar.gz
Tests: Cope with broken HTTP servers.
* tests/socks5.c (main): Use GET instead of HEAD
-rw-r--r--tests/socks5.c14
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);