From: Uwe Schindler Date: Sat, 29 Nov 2008 19:36:40 +0000 (+0000) Subject: remove one stat call and replace by cached one X-Git-Tag: BEFORE_HEAD_NS_CHANGES_MERGE~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba4ed0395a3d89f8b292d5f663cd01d9664dcee1;p=php remove one stat call and replace by cached one --- diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c index 151b3242b0..d02cd52e38 100644 --- a/sapi/nsapi/nsapi.c +++ b/sapi/nsapi/nsapi.c @@ -481,10 +481,6 @@ static void sapi_nsapi_flush(void *server_context) nsapi_request_context *rc = (nsapi_request_context *)server_context; TSRMLS_FETCH(); - if (!rc) { - return; - } - if (!SG(headers_sent)) { sapi_send_headers(TSRMLS_C); } @@ -965,7 +961,7 @@ int NSAPI_PUBLIC php6_execute(pblock *pb, Session *sn, Request *rq) int retval; nsapi_request_context *request_context; zend_file_handle file_handle = {0}; - struct stat fst; + struct stat *fst; char *path_info; char *query_string = pblock_findval("query", rq->reqpb); @@ -1037,7 +1033,8 @@ int NSAPI_PUBLIC php6_execute(pblock *pb, Session *sn, Request *rq) file_handle.free_filename = 0; file_handle.opened_path = NULL; - if (stat(SG(request_info).path_translated, &fst)==0 && S_ISREG(fst.st_mode)) { + fst = request_stat_path(SG(request_info).path_translated, rq); + if (fst && S_ISREG(fst->st_mode)) { if (php_request_startup(TSRMLS_C) == SUCCESS) { php_execute_script(&file_handle TSRMLS_CC); php_request_shutdown(NULL);