diff options
author | Graham Leggett <minfrin@apache.org> | 2011-12-03 00:18:39 +0100 |
---|---|---|
committer | Graham Leggett <minfrin@apache.org> | 2011-12-03 00:18:39 +0100 |
commit | a81bd8f675851ecb190e9daa5140b0e248a73ca5 (patch) | |
tree | 0ffd43daa372a7664576413583840c758750e9fd /modules/proxy/proxy_util.c | |
parent | update MMN, not only the comment (diff) | |
download | apache2-a81bd8f675851ecb190e9daa5140b0e248a73ca5.tar.xz apache2-a81bd8f675851ecb190e9daa5140b0e248a73ca5.zip |
mod_proxy: Move ap_proxy_string_read() out of the public API into
mod_proxy_ftp.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209776 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | modules/proxy/proxy_util.c | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 727809a7ef..9e91460ec7 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -951,80 +951,6 @@ PROXY_DECLARE(int) ap_proxy_pre_http_request(conn_rec *c, request_rec *r) return OK; } -/* - * converts a series of buckets into a string - * XXX: BillS says this function performs essentially the same function as - * ap_rgetline() in protocol.c. Deprecate this function and use ap_rgetline() - * instead? I think ap_proxy_string_read() will not work properly on non ASCII - * (EBCDIC) machines either. - */ -PROXY_DECLARE(apr_status_t) ap_proxy_string_read(conn_rec *c, apr_bucket_brigade *bb, - char *buff, apr_size_t bufflen, int *eos) -{ - apr_bucket *e; - apr_status_t rv; - char *pos = buff; - char *response; - int found = 0; - apr_size_t len; - - /* start with an empty string */ - buff[0] = 0; - *eos = 0; - - /* loop through each brigade */ - while (!found) { - /* get brigade from network one line at a time */ - if (APR_SUCCESS != (rv = ap_get_brigade(c->input_filters, bb, - AP_MODE_GETLINE, - APR_BLOCK_READ, - 0))) { - return rv; - } - /* loop through each bucket */ - while (!found) { - if (*eos || APR_BRIGADE_EMPTY(bb)) { - /* The connection aborted or timed out */ - return APR_ECONNABORTED; - } - e = APR_BRIGADE_FIRST(bb); - if (APR_BUCKET_IS_EOS(e)) { - *eos = 1; - } - else { - if (APR_SUCCESS != (rv = apr_bucket_read(e, - (const char **)&response, - &len, - APR_BLOCK_READ))) { - return rv; - } - /* - * is string LF terminated? - * XXX: This check can be made more efficient by simply checking - * if the last character in the 'response' buffer is an ASCII_LF. - * See ap_rgetline() for an example. - */ - if (memchr(response, APR_ASCII_LF, len)) { - found = 1; - } - /* concat strings until buff is full - then throw the data away */ - if (len > ((bufflen-1)-(pos-buff))) { - len = (bufflen-1)-(pos-buff); - } - if (len > 0) { - memcpy(pos, response, len); - pos += len; - } - } - APR_BUCKET_REMOVE(e); - apr_bucket_destroy(e); - } - *pos = '\0'; - } - - return APR_SUCCESS; -} - /* unmerge an element in the table */ PROXY_DECLARE(void) ap_proxy_table_unmerge(apr_pool_t *p, apr_table_t *t, char *key) { |