]> granicus.if.org Git - php/commitdiff
remove one stat call and replace by cached one
authorUwe Schindler <thetaphi@php.net>
Sat, 29 Nov 2008 19:36:40 +0000 (19:36 +0000)
committerUwe Schindler <thetaphi@php.net>
Sat, 29 Nov 2008 19:36:40 +0000 (19:36 +0000)
sapi/nsapi/nsapi.c

index 151b3242b057ffc1f1622214735d2f93835f5e3f..d02cd52e38cabaf4120cef3c82f714a078b164e1 100644 (file)
@@ -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);