* caused by MIME folding (or broken clients) if fold != 0, and place it
* in the buffer s, of size n bytes, without the ending newline.
*
- * If s is NULL, ap_fgetline_impl will allocate necessary memory from p.
+ * If s is NULL, ap_fgetline_core will allocate necessary memory from p.
*
* Returns APR_SUCCESS if there are no problems and sets *read to be
* the full length of s.
* If no LF is detected on the last line due to a dropped connection
* or a full buffer, that's considered an error.
*/
-static apr_status_t ap_fgetline_impl(char **s, apr_size_t n,
+static apr_status_t ap_fgetline_core(char **s, apr_size_t n,
apr_size_t *read, ap_filter_t *f,
int flags, apr_bucket_brigade *bb,
apr_pool_t *p)
next_size = n - bytes_handled;
- rv = ap_fgetline_impl(&tmp, next_size, &next_len, f,
+ rv = ap_fgetline_core(&tmp, next_size, &next_len, f,
flags & ~AP_GETLINE_FOLD, bb, p);
if (rv != APR_SUCCESS) {
goto cleanup;
int flags, apr_bucket_brigade *bb,
apr_pool_t *p)
{
- return ap_fgetline_impl(s, n, read, f, flags, bb, p);
+ apr_status_t rv;
+
+ rv = ap_fgetline_core(s, n, read, f, flags, bb, p);
+
+#if APR_CHARSET_EBCDIC
+ /* On EBCDIC boxes, each complete http protocol input line needs to be
+ * translated into the code page used by the compiler. Since
+ * ap_fgetline_core uses recursion, we do the translation in a wrapper
+ * function to ensure that each input character gets translated only once.
+ */
+ if (*read) {
+ ap_xlate_proto_from_ascii(*s, *read);
+ }
+#endif
+
+ return rv;
}
/* Same as ap_fgetline(), working on r's pool and protocol input filters.
apr_size_t *read, request_rec *r,
int flags, apr_bucket_brigade *bb)
{
- return ap_fgetline_impl(s, n, read, r->proto_input_filters, flags,
+ return ap_fgetline_core(s, n, read, r->proto_input_filters, flags,
bb, r->pool);
}
*
* on EBCDIC boxes, each complete http protocol input line needs to be
* translated into the code page used by the compiler. Since
- * ap_rgetline_core uses recursion, we do the translation in a wrapper
+ * ap_fgetline_core uses recursion, we do the translation in a wrapper
* function to ensure that each input character gets translated only once.
*/
apr_status_t rv;
- rv = ap_fgetline_impl(s, n, read, r->proto_input_filters, flags,
+ rv = ap_fgetline_core(s, n, read, r->proto_input_filters, flags,
bb, r->pool);
if (*read) {
ap_xlate_proto_from_ascii(*s, *read);
}
+
return rv;
}
#endif
}
tmp_bb = apr_brigade_create(r->pool, r->connection->bucket_alloc);
- rv = ap_fgetline_impl(&s, n, &len, r->proto_input_filters, flags,
- tmp_bb, r->pool);
+ rv = ap_rgetline(&s, n, &len, r, flags, tmp_bb);
apr_brigade_destroy(tmp_bb);
/* Map the out-of-space condition to the old API. */