changeset 3962:df2ae4bc7415

fix SSL connection issues on platforms with 32-bit off_t patch by Maxim Dounin
author Igor Sysoev <igor@sysoev.ru>
date Fri, 22 Jul 2011 12:53:04 +0000
parents 4048aa055411
children 10fbb8f02a45
files src/core/ngx_config.h src/event/ngx_event_openssl.c
diffstat 2 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/core/ngx_config.h	Fri Jul 22 10:43:50 2011 +0000
+++ b/src/core/ngx_config.h	Fri Jul 22 12:53:04 2011 +0000
@@ -127,5 +127,7 @@
 #define NGX_MAX_UINT32_VALUE  (uint32_t) 0xffffffff
 #endif
 
+#define NGX_MAX_INT32_VALUE   (uint32_t) 0x7fffffff
+
 
 #endif /* _NGX_CONFIG_H_INCLUDED_ */
--- a/src/event/ngx_event_openssl.c	Fri Jul 22 10:43:50 2011 +0000
+++ b/src/event/ngx_event_openssl.c	Fri Jul 22 12:53:04 2011 +0000
@@ -986,10 +986,10 @@
     }
 
 
-    /* the maximum limit size is the maximum uint32_t value - the page size */
-
-    if (limit == 0 || limit > (off_t) (NGX_MAX_UINT32_VALUE - ngx_pagesize)) {
-        limit = NGX_MAX_UINT32_VALUE - ngx_pagesize;
+    /* the maximum limit size is the maximum int32_t value - the page size */
+
+    if (limit == 0 || limit > (off_t) (NGX_MAX_INT32_VALUE - ngx_pagesize)) {
+        limit = NGX_MAX_INT32_VALUE - ngx_pagesize;
     }
 
     buf = c->ssl->buf;