{
BIO_bucket_in_t *inbio = BIO_bucket_in_ptr(bio);
int len = 0;
- apr_off_t readbytes = inl;
/* XXX: flush here only required for SSLv2;
* OpenSSL calls BIO_flush() at the appropriate times for
if ((len <= inl) || inbio->mode == AP_MODE_GETLINE) {
return len;
}
+ inl -= len;
}
while (1) {
* GETLINE.
*/
inbio->rc = ap_get_brigade(inbio->f->next, inbio->bb,
- AP_MODE_READBYTES, inbio->block, &readbytes);
+ AP_MODE_READBYTES, inbio->block,
+ inl);
if ((inbio->rc != APR_SUCCESS) || APR_BRIGADE_EMPTY(inbio->bb))
{
apr_bucket_brigade *bb,
ap_input_mode_t mode,
apr_read_type_e block,
- apr_off_t *readbytes)
+ apr_off_t readbytes)
{
apr_status_t status;
ssl_io_input_ctx_t *ctx = f->ctx;
apr_size_t len = sizeof(ctx->buffer);
- apr_off_t bytes = *readbytes;
int is_init = (mode == AP_MODE_INIT);
/* XXX: we don't currently support anything other than these modes. */
if (ctx->inbio.mode == AP_MODE_READBYTES ||
ctx->inbio.mode == AP_MODE_SPECULATIVE) {
- /* Protected from truncation, bytes < MAX_SIZE_T */
- if (bytes < len) {
- len = (apr_size_t)bytes;
+ /* Protected from truncation, readbytes < MAX_SIZE_T
+ * FIXME: No, it's *not* protected. -- jre */
+ if (readbytes < len) {
+ len = (apr_size_t)readbytes;
}
status = ssl_io_input_read(ctx, ctx->buffer, &len);
}
APR_BRIGADE_INSERT_TAIL(bb, bucket);
}
- *readbytes = len;
-
return APR_SUCCESS;
}