diff options
author | Igor Sysoev <igor@sysoev.ru> | 2011-07-22 12:53:04 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2011-07-22 12:53:04 +0000 |
commit | b0b6bcedfc4b74bfe13b55b684a9cfc9e03ac100 (patch) | |
tree | 3efa4b77ee736da71cb0af660cf071c809fb85c6 /src | |
parent | a7ed0951e36464ff82961aff1cd6404cfa50bcd4 (diff) | |
download | nginx-b0b6bcedfc4b74bfe13b55b684a9cfc9e03ac100.tar.gz nginx-b0b6bcedfc4b74bfe13b55b684a9cfc9e03ac100.zip |
fix SSL connection issues on platforms with 32-bit off_t
patch by Maxim Dounin
Diffstat (limited to 'src')
-rw-r--r-- | src/core/ngx_config.h | 2 | ||||
-rw-r--r-- | src/event/ngx_event_openssl.c | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h index ab73079a6..9762b18ca 100644 --- a/src/core/ngx_config.h +++ b/src/core/ngx_config.h @@ -127,5 +127,7 @@ typedef intptr_t ngx_flag_t; #define NGX_MAX_UINT32_VALUE (uint32_t) 0xffffffff #endif +#define NGX_MAX_INT32_VALUE (uint32_t) 0x7fffffff + #endif /* _NGX_CONFIG_H_INCLUDED_ */ diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c index 297181742..692f50639 100644 --- a/src/event/ngx_event_openssl.c +++ b/src/event/ngx_event_openssl.c @@ -986,10 +986,10 @@ ngx_ssl_send_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit) } - /* the maximum limit size is the maximum uint32_t value - the page size */ + /* the maximum limit size is the maximum int32_t value - the page size */ - if (limit == 0 || limit > (off_t) (NGX_MAX_UINT32_VALUE - ngx_pagesize)) { - limit = NGX_MAX_UINT32_VALUE - ngx_pagesize; + if (limit == 0 || limit > (off_t) (NGX_MAX_INT32_VALUE - ngx_pagesize)) { + limit = NGX_MAX_INT32_VALUE - ngx_pagesize; } buf = c->ssl->buf; |