]> granicus.if.org Git - php/commitdiff
Handle special queries.
authorSascha Schumann <sas@php.net>
Thu, 26 Oct 2000 21:23:20 +0000 (21:23 +0000)
committerSascha Schumann <sas@php.net>
Thu, 26 Oct 2000 21:23:20 +0000 (21:23 +0000)
Apache's default handler does not seem to handle flushes correctly yet.
One more project..

sapi/apache2filter/apache_config.c
sapi/apache2filter/sapi_apache2.c

index fa704740d360d8c44323e9e55276a17bd2c28e92..eca4a2463e5ca5828b919bf362ae4107b2541638 100644 (file)
@@ -66,7 +66,6 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
        char *str;
        ulong str_len;
        ulong num_index;
-       char buf[256];
 
        fprintf(stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf);
        for (zend_hash_internal_pointer_reset(&d->config);
@@ -78,8 +77,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
                        if (pe->status >= data->status) continue;
                }
                zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
-               sprintf(buf, "ADDING/OVERWRITING %%%lds (%d vs. %d)\n", str_len, data->status, pe?pe->status:-1);
-               fprintf(stderr, buf, str);
+               fprintf(stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1);
        }
        return new_conf;
 }
index c715418b975f69f5d0404e9c490796b988f2fcf8..902dac2992b8a6cb4515cd7a7f762b08881638d9 100644 (file)
@@ -116,12 +116,15 @@ static void
 php_apache_sapi_flush(void *server_context)
 {
        php_struct *ctx = server_context;
-       return;
-
-       /* This does not work yet. Apparently, the default handler
-          interpretes bucket flush as EOS */
+       ap_bucket_brigade *bb;
+       ap_bucket *b;
 
-       ap_rflush(ctx->f->r);
+       bb = ap_brigade_create(ctx->f->r->pool);
+       b = ap_bucket_create_flush();
+       AP_BRIGADE_INSERT_TAIL(bb, b);
+       ap_pass_brigade(ctx->f->next, bb);
+       
+       return;
 }
 
 static sapi_module_struct sapi_module = {
@@ -192,6 +195,8 @@ static int php_filter(ap_filter_t *f, ap_bucket_brigade *bb)
 
                PG(during_request_startup) = 0;
                SG(sapi_headers).http_response_code = 200;
+               SG(request_info).query_string = f->r->args;
+               f->r->no_cache = f->r->no_local_copy = 1;
                content_type = sapi_get_default_content_type(SLS_C);
                f->r->content_type = apr_pstrdup(f->r->pool, 
                                content_type);
@@ -213,15 +218,18 @@ static int php_filter(ap_filter_t *f, ap_bucket_brigade *bb)
                PLS_FETCH();
 
                ctx->state = 2;
+
+               if (php_handle_special_queries(SLS_C PLS_CC)) 
+                       goto skip_execution;
                
                AP_BRIGADE_FOREACH(b, ctx->bb) {
                        rv = ap_bucket_read(b, &str, &n, 1);
                        if (rv == APR_SUCCESS && n > 0)
                                smart_str_appendl(&content, str, n);
                }
-               if (!content.c) goto fucked;
+               if (!content.c) goto skip_execution;
                smart_str_0(&content);
-               
+
 #if 1
 #define FFFF "/tmp/really_silly"
                fd = open(FFFF, O_WRONLY|O_TRUNC|O_CREAT, 0600);
@@ -242,7 +250,7 @@ static int php_filter(ap_filter_t *f, ap_bucket_brigade *bb)
 #endif
 
                smart_str_free(&content);
-fucked:
+skip_execution:
                php_request_shutdown(NULL);
 
                eos = ap_bucket_create_eos();