From: Sascha Schumann Date: Thu, 26 Oct 2000 21:23:20 +0000 (+0000) Subject: Handle special queries. X-Git-Tag: php-4.0.4RC3~512 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3a263dcd99d675bc17e1de35eda2ad3a0e19d164;p=php Handle special queries. Apache's default handler does not seem to handle flushes correctly yet. One more project.. --- diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index fa704740d3..eca4a2463e 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -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; } diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index c715418b97..902dac2992 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -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();