httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)" <madhusudan_mathiha...@hp.com>
Subject RE: are we ready to roll? - POST thru' mod_ssl
Date Fri, 10 Aug 2001 18:57:06 GMT
Here comes that patch.. Basically, if you see here, I've copied the
apr_bridage_length functionality within the while loop, and replaced the
apr_bucket_read with APR_NONBLOCK_READ flag.. That's the only change to the
patch that Ryan suggested..

Index: http_protocol.c
===================================================================
RCS file: /home/cvspublic/httpd-2.0/modules/http/http_protocol.c,v
retrieving revision 1.351
diff -u -r1.351 http_protocol.c
--- http_protocol.c     2001/08/09 04:56:23     1.351
+++ http_protocol.c     2001/08/10 18:52:18
@@ -669,17 +669,45 @@
     }
     /* readbytes == 0 is "read a single line". otherwise, read a block. */
     if (*readbytes) {
-        apr_off_t total;
+        apr_off_t total = 0;
 
         /* ### the code below, which moves bytes from one brigade to the
            ### other is probably bogus. presuming the next filter down was
            ### working properly, it should not have returned more than
            ### READBYTES bytes, and we wouldn't have to do any work.
         */
+        while (1)
+        {
+            apr_bucket *bkt;
 
+            APR_BRIGADE_FOREACH(bkt, ctx->b) {
+                if (bkt->length == (apr_size_t)(-1)) {
+                    const char *ignore;
+                    apr_size_t len;
+                    apr_status_t status;
+
+                    if ((status = apr_bucket_read(bkt, &ignore, &len,
+                                          APR_NONBLOCK_READ)) !=
APR_SUCCESS)
+                        break;
+                }
+                total += bkt->length;
+            }
+            if (total > 0) {
+                break;
+            }
+            if ((rv = ap_get_brigade(f->next, ctx->b, mode, readbytes)) !=
APR_SUCCESS) {
+                return rv;
+            }
+        }
+
         apr_brigade_partition(ctx->b, *readbytes, &e);
         APR_BRIGADE_CONCAT(b, ctx->b);
-        ctx->b = apr_brigade_split(b, e);
+        if (e != APR_BRIGADE_SENTINEL(ctx->b)) {
+            ctx->b = apr_brigade_split(b, e);
+        }
+        else {
+            ctx->b = NULL;
+        }
         apr_brigade_length(b, 1, &total);
         *readbytes -= total;
 

Thanks
-Madhu


-----Original Message-----
From: MATHIHALLI,MADHUSUDAN (HP-Cupertino,ex1)
[mailto:madhusudan_mathihalli@hp.com]
Sent: Friday, August 10, 2001 11:48 AM
To: 'new-httpd@apache.org'
Subject: RE: are we ready to roll? - POST thru' mod_ssl


The problem appears to go away if we can have apr_bucket_read read in
APR_NONBLOCK_MODE in the apr_brigade_length ().. I can post a patch if
required..

Thanks
-Madhu

-----Original Message-----
From: Doug MacEachern [mailto:dougm@covalent.net]
Sent: Friday, August 10, 2001 10:25 AM
To: Ryan Bloom
Cc: new-httpd@apache.org
Subject: Re: are we ready to roll? - POST thru' mod_ssl


cool, that fixes ssl, but non-ssl hangs now:

#0  0x401701de in __select () from /lib/libc.so.6
#1  0xbfffb5b0 in ?? ()
#2  0x80df206 in apr_recv (sock=0x8243afc, 
    buf=0x85117c0 "\210\206\e@\210\206\e@ 200 OK\r\nDate: Fri, 10 Aug 2001
17:19:11 GMT\r\nServer: Apache/2.0.24-dev (Unix) mod_ssl/3.0a0
OpenSSL/0.9.6 mod_perl/1.99_01-dev
Perl/v5.7.2\r\nContent-Length: 2000\r\nConnection: close\r\nContent-Ty"...,
len=0xbfffb6c8) at sendrecv.c:142
#3  0x80d2e7d in socket_read (a=0x85117a0, str=0xbfffb6c4, len=0xbfffb6c8, 
    block=APR_BLOCK_READ) at apr_buckets_socket.c:75
#4  0x80d20bd in apr_brigade_length (bb=0x8243e2c, read_all=1, 
    length=0xbfffb6fc) at apr_brigade.c:209
#5  0x809a66b in ap_http_filter (f=0x8243ddc, b=0x84e101c, 
    mode=AP_MODE_BLOCKING, readbytes=0x84e0928) at http_protocol.c:680
#6  0x80bf8ea in ap_get_brigade (next=0x8243ddc, bb=0x84e101c, 
    mode=AP_MODE_BLOCKING, readbytes=0x84e0928) at util_filter.c:217
#7  0x809be22 in ap_get_client_block (r=0x84e08ac, 
    buffer=0xbfffb7a0 'x' <repeats 200 times>..., bufsiz=8192)
    at http_protocol.c:1517
#8  0x40017ad2 in echo_post_handler (r=0x84e08ac) at mod_echo_post.c:44
#9  0x80b3417 in ap_run_handler (r=0x84e08ac) at config.c:186
#10 0x80b3a99 in ap_invoke_handler (r=0x84e08ac) at config.c:344
#11 0x809e6e5 in process_request_internal (r=0x84e08ac) at
http_request.c:378
#12 0x809e809 in ap_process_request (r=0x84e08ac) at http_request.c:444


Mime
View raw message