summaryrefslogtreecommitdiff
path: root/sapi/nsapi/nsapi.c
diff options
context:
space:
mode:
authorUwe Schindler <thetaphi@php.net>2008-11-29 19:37:06 +0000
committerUwe Schindler <thetaphi@php.net>2008-11-29 19:37:06 +0000
commit7db781fc1b3fa7b774b77d691048090a7b2c9827 (patch)
treecc1e7a35daa491c2fa85aeed9b9ef04994b814b8 /sapi/nsapi/nsapi.c
parent2f49305bc8923a4c92999250ffeabbb59ddcb0ae (diff)
downloadphp-git-7db781fc1b3fa7b774b77d691048090a7b2c9827.tar.gz
MFH: remove one stat call and replace by cached one
Diffstat (limited to 'sapi/nsapi/nsapi.c')
-rw-r--r--sapi/nsapi/nsapi.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/sapi/nsapi/nsapi.c b/sapi/nsapi/nsapi.c
index 5a7a4d0059..1e404bdc58 100644
--- a/sapi/nsapi/nsapi.c
+++ b/sapi/nsapi/nsapi.c
@@ -483,10 +483,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);
}
@@ -969,7 +965,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);
@@ -1041,7 +1037,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);