more info www.naraicoms.com
From: [EMAIL PROTECTED] Reply-To: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: cvs commit: httpd-2.0/modules/ssl ssl_engine_io.c Date: 23 Jan 2004 16:50:24 -0000
jorton 2004/01/23 08:50:24
Modified: . CHANGES modules/ssl ssl_engine_io.c Log: * modules/ssl/ssl_engine_io.c (ssl_io_filter_output): Use non-blocking bucket reads whilst data remains available; flush when a read returns EAGAIN. Fixes streaming nph- CGI scripts over SSL.
PR: 21944 Inspired by: Jeff Trawick
Revision Changes Path 1.1373 +3 -0 httpd-2.0/CHANGES
Index: CHANGES =================================================================== RCS file: /home/cvs/httpd-2.0/CHANGES,v retrieving revision 1.1372 retrieving revision 1.1373 diff -b -d -u -r1.1372 -r1.1373 --- CHANGES 23 Jan 2004 00:08:16 -0000 1.1372 +++ CHANGES 23 Jan 2004 16:50:23 -0000 1.1373 @@ -2,6 +2,9 @@
[Remove entries to the current 2.0 section below, when backported]
+ *) mod_ssl: Fix streaming output from an nph- CGI script. PR 21944 + [Joe Orton] + *) mod_log_config: Fix corruption of buffered logs with threaded MPMs. PR 25520. [Jeff Trawick]
1.114 +17 -3 httpd-2.0/modules/ssl/ssl_engine_io.c
Index: ssl_engine_io.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v retrieving revision 1.113 retrieving revision 1.114 diff -b -d -u -r1.113 -r1.114 --- ssl_engine_io.c 1 Jan 2004 13:26:21 -0000 1.113 +++ ssl_engine_io.c 23 Jan 2004 16:50:24 -0000 1.114 @@ -1370,6 +1370,8 @@ apr_status_t status = APR_SUCCESS; ssl_filter_ctx_t *filter_ctx = f->ctx; bio_filter_in_ctx_t *inctx; + bio_filter_out_ctx_t *outctx; + apr_read_type_e rblock = APR_NONBLOCK_READ;
if (f->c->aborted) { apr_brigade_cleanup(bb); @@ -1382,6 +1384,8 @@ }
inctx = (bio_filter_in_ctx_t *)filter_ctx->pbioRead->ptr;
+ outctx = (bio_filter_out_ctx_t *)filter_ctx->pbioWrite->ptr;
+
/* When we are the writer, we must initialize the inctx
* mode so that we block for any required ssl input, because
* output filtering is always nonblocking.
@@ -1401,8 +1405,6 @@
*/
if (APR_BUCKET_IS_EOS(bucket) || APR_BUCKET_IS_FLUSH(bucket)) {
if (bio_filter_out_flush(filter_ctx->pbioWrite) < 0) {
- bio_filter_out_ctx_t *outctx =
- (bio_filter_out_ctx_t *)(filter_ctx->pbioWrite->ptr);
status = outctx->rc;
break;
}
@@ -1432,7 +1434,19 @@
const char *data;
apr_size_t len;
- status = apr_bucket_read(bucket, &data, &len, APR_BLOCK_READ);
+ status = apr_bucket_read(bucket, &data, &len, rblock);
+
+ if (APR_STATUS_IS_EAGAIN(status)) {
+ /* No data available: flush... */
+ if (bio_filter_out_flush(filter_ctx->pbioWrite) < 0) {
+ status = outctx->rc;
+ break;
+ }
+ rblock = APR_BLOCK_READ;
+ continue; /* and try again with a blocking read. */
+ }
+
+ rblock = APR_NONBLOCK_READ;
if (!APR_STATUS_IS_EOF(status) && (status != APR_SUCCESS)) {
break;
_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963
