summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Orton <jorton@redhat.com>2019-04-08 10:32:27 +0100
committerJoe Orton <jorton@redhat.com>2019-04-08 10:41:10 +0100
commit0365f1d258c5b7a462804582749836f5796db0ff (patch)
treee9d51e972fd8f8d89ca1117fb1a5fa84e2c1c960
parent0b8c080fa374ab5b12e75418defde6304df3acad (diff)
downloadneon-git-0365f1d258c5b7a462804582749836f5796db0ff.tar.gz
* test/redirect.c (no_redirect): Switch to using double_serve_sstring.
-rw-r--r--test/redirect.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/test/redirect.c b/test/redirect.c
index e7ecc19..42deadb 100644
--- a/test/redirect.c
+++ b/test/redirect.c
@@ -166,17 +166,23 @@ static int fail_loop(void)
#endif
#if 01
+
+#define RESP1 "HTTP/1.1 200 OK\r\n" "Content-Length: 0\r\n\r\n"
+#define RESP2 "HTTP/1.0 302 Get Ye Away\r\n" "Location: /blah\r\n" "\r\n"
/* ensure that ne_redirect_location returns NULL when no redirect has
* been encountered, or redirect hooks aren't registered. */
static int no_redirect(void)
{
ne_session *sess;
const ne_uri *loc;
+ struct double_serve_args resp;
+
+ resp.first.data = RESP1;
+ resp.first.len = strlen(RESP1);
+ resp.second.data = RESP2;
+ resp.second.len = strlen(RESP2);
- CALL(session_server(&sess, single_serve_string,
- "HTTP/1.1 200 OK\r\n" "Content-Length: 0\r\n\r\n"
- "HTTP/1.0 302 Get Ye Away\r\n"
- "Location: /blah\r\n" "\r\n"));
+ CALL(session_server(&sess, double_serve_sstring, &resp));
ONN("redirect non-NULL before register", ne_redirect_location(sess));
ne_redirect_register(sess);
ONN("initial redirect non-NULL", ne_redirect_location(sess));