[Pkg-gnupg-commit] [libassuan] 04/11: Tests: Cope with broken HTTP servers.
Eric Dorland
eric at moszumanska.debian.org
Thu Nov 12 16:14:47 UTC 2015
This is an automated email from the git hooks/post-receive script.
eric pushed a commit to branch master
in repository libassuan.
commit dda9c84bc67326a6d2bef1e5c45b5de8b67eeb40
Author: Werner Koch <wk at gnupg.org>
Date: Mon Oct 26 21:04:54 2015 +0100
Tests: Cope with broken HTTP servers.
* tests/socks5.c (main): Use GET instead of HEAD
---
tests/socks5.c | 14 ++++++++++++--
1 file 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);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/libassuan.git
More information about the Pkg-gnupg-commit
mailing list