diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2008-04-03 10:59:30 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2008-04-03 10:59:30 +0000 |
commit | c6440e70f8b85d59befd20c2d430e9664dbbde25 (patch) | |
tree | 740a15a21eb2269ba94625458e7fb1baae506d1e /test/utils.c | |
parent | 70eb8b8e624ab65b5cea4f5d5e31c4521cb30d91 (diff) | |
download | neon-c6440e70f8b85d59befd20c2d430e9664dbbde25.tar.gz |
* test/utils.c (double_serve_sstring): New function.
* test/compress.c (retry_notcompress, retry_compress_helper,
retry_compress):Use double_serve_sstring.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1439 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test/utils.c')
-rw-r--r-- | test/utils.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/utils.c b/test/utils.c index 3cc63e1..74406bc 100644 --- a/test/utils.c +++ b/test/utils.c @@ -1,6 +1,6 @@ /* Utility functions for HTTP client tests - Copyright (C) 2001-2004, Joe Orton <joe@manyfish.co.uk> + Copyright (C) 2001-2008, Joe Orton <joe@manyfish.co.uk> This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,6 +53,30 @@ int single_serve_string(ne_socket *s, void *userdata) return serve_response(s, str); } +int double_serve_sstring(ne_socket *s, void *userdata) +{ + struct double_serve_args *args = userdata; + struct string *str; + + CALL(discard_request(s)); + CALL(discard_body(s)); + + str = &args->first; + NE_DEBUG(NE_DBG_SOCKET, "Serving string: [[[%.*s]]]\n", + (int)str->len, str->data); + ONN("write failed", ne_sock_fullwrite(s, str->data, str->len)); + + CALL(discard_request(s)); + CALL(discard_body(s)); + + str = &args->second; + NE_DEBUG(NE_DBG_SOCKET, "Serving string: [[[%.*s]]]\n", + (int)str->len, str->data); + ONN("write failed", ne_sock_fullwrite(s, str->data, str->len)); + + return OK; +} + int sleepy_server(ne_socket *sock, void *userdata) { sleep(10); |