httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Plüm, Rüdiger, VF-Group <ruediger.pl...@vodafone.com>
Subject httpd/sandbox/amsterdam/d/modules/proxy/mod_serf.c?revision=595110&view=markup
Date Thu, 15 Nov 2007 12:02:10 GMT

-    if (APR_BRIGADE_SENTINEL(ctx->bb)) {
+    if (APR_BRIGADE_EMPTY(ctx->bb)) {
+        *len = 0;
+        return APR_EOF;
+    }
+
+    if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(ctx->bb)) ||
+        AP_BUCKET_IS_EOR(APR_BRIGADE_FIRST(ctx->bb))) {
         *len = 0;
         return APR_EOF;

Why do we not put this in one if block like?

if (APR_BRIGADE_SENTINEL(ctx->bb) ||
    APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(ctx->bb)) ||
    AP_BUCKET_IS_EOR(APR_BRIGADE_FIRST(ctx->bb))) {
    *len = 0;
    return APR_EOF;
}

@@ -567,8 +567,21 @@
         return APR_SUCCESS;
     }
 
-    if (mode == AP_MODE_EATCRLF || mode == AP_MODE_EXHAUSTIVE ||
-        mode == AP_MODE_SPECULATIVE) {
+    if (mode == AP_MODE_SPECULATIVE) {
+        const char *data;
+        apr_size_t len;
+        apr_bucket *b;
+        serf_bucket_t *sb;
+
+        ctx->serf_bucket_status = serf_bucket_read(ctx->serf_in_bucket,
+                                                   readbytes, &data, &len);
+        
+        sb = serf_bucket_simple_create(data, len, NULL, NULL, ctx->serf_bkt_alloc);
+        serf_bucket_aggregate_prepend(ctx->serf_in_bucket, sb);

Hm. Don't we need the following lines here?

        b = apr_bucket_transient_create(data, len, f->c->bucket_alloc);
        APR_BRIGADE_INSERT_TAIL(bb, b);

Otherwise I guess we read the data but do not return it :-).


+        return APR_SUCCESS;
+    }
+    
+    if (mode == AP_MODE_EATCRLF || mode == AP_MODE_EXHAUSTIVE) {
         abort();
     }
 }

Regards

Rüdiger

Mime
View raw message