X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http_api.c;h=6f39434d7b76ef6e429db5b5cce86ad8a1fcb77d;hb=ab7789c3bd6f1a3e6b1ce078f5acbb462ed98f1b;hp=a5b898d8f6931ce91d6a33ff269686b85d4e910f;hpb=21ef2bd1b65e683b5a6cca71de490528f9e0f80b;p=m6w6%2Fext-http diff --git a/http_api.c b/http_api.c index a5b898d..6f39434 100644 --- a/http_api.c +++ b/http_api.c @@ -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; } } }