diff options
author | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-11 19:59:58 +0000 |
---|---|---|
committer | joe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845> | 2004-10-11 19:59:58 +0000 |
commit | 1ac419d11e26600ca9b28f216cabb5c77b27adaf (patch) | |
tree | d63c6233f5787ea62d294c4f892514b962572075 /test/compress.c | |
parent | 39aabf2eb660abdc724a5c4b0629c3e360c2bff7 (diff) | |
download | neon-1ac419d11e26600ca9b28f216cabb5c77b27adaf.tar.gz |
Allow response body callbacks to return an error:
* src/ne_request.h (ne_block_reader): Return error code.
* src/ne_request.c (ne_read_response_block): Fail with -1 if a reader
callback returns an error.
* src/ne_xml.c (ne_xml_parse_v): Return 0 (for the moment).
* src/ne_basic.c (get_to_fd): Return error.
* src/ne_compress.c (gz_reader): Return 0 (mostly), or pass through.
* src/ne_auth.c (auth_body_reader): Return 0.
* test/compress.c (reader): Return error.
* test/request.c (collector): Return 0.
(abortive_reader, abort_reader): New functions.
git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@308 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
Diffstat (limited to 'test/compress.c')
-rw-r--r-- | test/compress.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/test/compress.c b/test/compress.c index df188e4..1a7cfce 100644 --- a/test/compress.c +++ b/test/compress.c @@ -47,7 +47,7 @@ static int init(void) #define EXTRA_DEBUG 0 /* disabled by default */ -static void reader(void *ud, const char *block, size_t len) +static int reader(void *ud, const char *block, size_t len) { struct string *b = ud; @@ -56,7 +56,7 @@ static void reader(void *ud, const char *block, size_t len) (int)len, block); #endif - if (failed == f_mismatch) return; + if (failed == f_mismatch) return -1; if (failed == f_partial && len == 0) { if (b->len != 0) { @@ -66,7 +66,7 @@ static void reader(void *ud, const char *block, size_t len) } else { failed = f_complete; } - return; + return 0; } if (len > b->len || memcmp(b->data, block, len) != 0) { @@ -81,6 +81,8 @@ static void reader(void *ud, const char *block, size_t len) (int)b->len); #endif } + + return 0; } static int file2buf(int fd, ne_buffer *buf) |