]> granicus.if.org Git - php/commitdiff
- #51273, Content-length header is limited to 32bit integer with apache2/windows
authorPierre Joye <pajoye@php.net>
Mon, 3 May 2010 17:47:58 +0000 (17:47 +0000)
committerPierre Joye <pajoye@php.net>
Mon, 3 May 2010 17:47:58 +0000 (17:47 +0000)
sapi/apache2handler/sapi_apache2.c

index e3367eaba8b78172f8d761ea96f2bb264ed50cac..24e489d7224da831210213eac5177c29306d73ad 100644 (file)
@@ -120,7 +120,15 @@ php_apache_sapi_header_handler(sapi_header_struct *sapi_header, sapi_header_op_e
                                }
                                ctx->content_type = estrdup(val);
                        } else if (!strcasecmp(sapi_header->header, "content-length")) {
-                               ap_set_content_length(ctx->r, strtol(val, (char **)NULL, 10));
+#ifdef PHP_WINDOWS
+# ifdef APR_HAS_LARGE_FILES
+                               ap_set_content_length(ctx->r, (apr_off_t) _strtoui64(val, (char **)NULL, 10));
+# else
+                               ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
+# endif
+#else
+                               ap_set_content_length(ctx->r, (apr_off_t) strtol(val, (char **)NULL, 10));
+#endif
                        } else if (op == SAPI_HEADER_REPLACE) {
                                apr_table_set(ctx->r->headers_out, sapi_header->header, val);
                        } else {