diff options
author | Justin Erenkrantz <jerenkrantz@apache.org> | 2002-01-20 12:43:37 +0100 |
---|---|---|
committer | Justin Erenkrantz <jerenkrantz@apache.org> | 2002-01-20 12:43:37 +0100 |
commit | 29aec5a92cdd6149adc147a0fc135661055993c8 (patch) | |
tree | 28961c8975b9e72c1fb11aa07f247548d1e41762 /server/core.c | |
parent | Add AP_MODE_SPECULATIVE support to core_input_filter (diff) | |
download | apache2-29aec5a92cdd6149adc147a0fc135661055993c8.tar.xz apache2-29aec5a92cdd6149adc147a0fc135661055993c8.zip |
Make core_input_filter use the new apr_brigade_split_line function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92944 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/core.c')
-rw-r--r-- | server/core.c | 45 |
1 files changed, 12 insertions, 33 deletions
diff --git a/server/core.c b/server/core.c index 19c05c7495..713c2716ec 100644 --- a/server/core.c +++ b/server/core.c @@ -3167,40 +3167,19 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, } /* we are reading a single LF line, e.g. the HTTP headers */ - while (!APR_BRIGADE_EMPTY(ctx->b)) { - const char *pos; - - e = APR_BRIGADE_FIRST(ctx->b); - rv = apr_bucket_read(e, &str, &len, block); - - /* We should treat EAGAIN here the same as we do for EOF (brigade is - * empty). We do this by returning whatever we have read. This may - * or may not be bogus, but is consistent (for now) with EOF logic. - */ - if (APR_STATUS_IS_EAGAIN(rv)) { - break; - } - else if (rv != APR_SUCCESS) { - return rv; - } + rv = apr_brigade_split_line(b, ctx->b, block, HUGE_STRING_LEN); + /* We should treat EAGAIN here the same as we do for EOF (brigade is + * empty). We do this by returning whatever we have read. This may + * or may not be bogus, but is consistent (for now) with EOF logic. + */ + if (APR_STATUS_IS_EAGAIN(rv) || rv == APR_SUCCESS) { + apr_off_t total; - pos = memchr(str, APR_ASCII_LF, len); - /* We found a match. */ - if (pos != NULL) { - apr_bucket_split(e, pos - str + 1); - APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(b, e); - *readbytes += pos - str; - return APR_SUCCESS; - } - APR_BUCKET_REMOVE(e); - APR_BRIGADE_INSERT_TAIL(b, e); - *readbytes += len; - /* We didn't find an APR_ASCII_LF within the predefined maximum - * line length. */ - if (*readbytes >= HUGE_STRING_LEN) { - break; - } + apr_brigade_length(b, 1, &total); + *readbytes = total; + } + else { + return rv; } return APR_SUCCESS; |