* typos/ws
[m6w6/ext-http] / http_api.c
index a5b898d8f6931ce91d6a33ff269686b85d4e910f..6f39434d7b76ef6e429db5b5cce86ad8a1fcb77d 100644 (file)
@@ -34,7 +34,6 @@
 #include "ext/standard/php_string.h"
 #include "ext/standard/php_smart_str.h"
 #include "ext/standard/php_lcg.h"
-#include "ext/standard/php_filestat.h"
 
 #include "SAPI.h"
 
@@ -563,7 +562,7 @@ static inline void _http_curl_setopts(CURL *ch, const char *url, HashTable *opti
 /* {{{ static inline char *http_curl_getinfoname(CURLINFO) */
 static inline char *_http_curl_getinfoname(CURLINFO i TSRMLS_DC)
 {
-#define CASE(I) case CURLINFO_ ##I : return pretty_key(estrdup( #I ), strlen(#I), 0, 0)
+#define CASE(I) case CURLINFO_ ##I : { static char I[] = #I; return pretty_key(I, sizeof(#I)-1, 0, 0); }
        switch (i)
        {
                /* CURLINFO_EFFECTIVE_URL                       =       CURLINFO_STRING +1, */
@@ -1061,9 +1060,12 @@ PHP_HTTP_API inline time_t _http_lmod(const void *data_ptr, const http_send_mode
 
                default:
                {
-                       zval mtime;
-                       php_stat(Z_STRVAL_P((zval *) data_ptr), Z_STRLEN_P((zval *) data_ptr), 6, &mtime TSRMLS_CC);
-                       return Z_LVAL(mtime);
+                       if (!HTTP_G(ssb).sb.st_mtime) {
+                               if(php_stream_stat_path(Z_STRVAL_P((zval *) data_ptr), &HTTP_G(ssb))) {
+                                       return 0;
+                               }
+                       }
+                       return HTTP_G(ssb).sb.st_mtime;
                }
        }
 }