From: Zeev Suraski Date: Thu, 10 Feb 2000 19:29:21 +0000 (+0000) Subject: The last patch wasn't that good, fix X-Git-Tag: BEFORE_SAPIFICATION_FEB_10_2000~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9709f7ec73557e0a1a85ad3fbc4c73806de50620;p=php The last patch wasn't that good, fix --- diff --git a/main/SAPI.c b/main/SAPI.c index 11e92e8e01..006789a474 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -378,15 +378,13 @@ SAPI_API int sapi_flush() if (sapi_module.flush) { SLS_FETCH(); - if (SG(server_context)) { - sapi_module.flush(SG(server_context)); - return SUCCESS; - } + sapi_module.flush(SG(server_context)); + return SUCCESS; + } else { + return FAILURE; } - return FAILURE; } - SAPI_API struct stat *sapi_get_stat() { SLS_FETCH(); diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index a242123166..86bab41fa2 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -149,11 +149,13 @@ static int sapi_apache_ub_write(const char *str, uint str_length) static void sapi_apache_flush(void *server_context) { + if (server_context) { #if MODULE_MAGIC_NUMBER > 19970110 - rflush((request_rec *) server_context); + rflush((request_rec *) server_context); #else - bflush((request_rec *) server_context->connection->client); + bflush((request_rec *) server_context->connection->client); #endif + } }