]> granicus.if.org Git - php/commitdiff
MFH: remove one stat call and replace by cached one
authorUwe Schindler <thetaphi@php.net>
Sat, 29 Nov 2008 19:38:04 +0000 (19:38 +0000)
committerUwe Schindler <thetaphi@php.net>
Sat, 29 Nov 2008 19:38:04 +0000 (19:38 +0000)
(release-manager: the same like with last commit)

sapi/nsapi/nsapi.c

index fdc8cb195523cbd6d3431573159fb1db1b4a4adf..2b2a316f8fb37c890c6805f85a9876326f60ea3e 100644 (file)
@@ -470,10 +470,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);
        }
@@ -913,7 +909,7 @@ int NSAPI_PUBLIC php5_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);
@@ -985,7 +981,8 @@ int NSAPI_PUBLIC php5_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);