Skip to content

Commit cd1f92a

Browse files
committed
changes for windows.
1 parent da1583b commit cd1f92a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

ext/standard/http_fopen_wrapper.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,14 @@ static php_stream *php_stream_url_wrap_http_ex(php_stream_wrapper *wrapper,
215215

216216
if (context && (tmpzval = php_stream_context_get_option(context, wrapper->wops->label, "timeout")) != NULL) {
217217
double d = zval_get_double(tmpzval);
218+
#ifndef PHP_WIN32
219+
const double timeoutmax = (double) PHP_TIMEOUT_ULL_MAX / 1000000.0;
220+
#else
221+
const double timeoutmax = (double) LONG_MAX / 1000000.0;
222+
#endif
218223

219-
if (d > (double) PHP_TIMEOUT_ULL_MAX / 1000000.0) {
220-
php_stream_wrapper_log_error(wrapper, options, "timeout must be lower than " ZEND_ULONG_FMT, (zend_ulong)((double) PHP_TIMEOUT_ULL_MAX / 1000000.0));
224+
if (d > timeoutmax) {
225+
php_stream_wrapper_log_error(wrapper, options, "timeout must be lower than " ZEND_ULONG_FMT, (zend_ulong)timeoutmax);
221226
zend_string_release(transport_string);
222227
php_url_free(resource);
223228
return NULL;

0 commit comments

Comments
 (0)