# HG changeset patch # User Igor Sysoev # Date 1311339184 0 # Node ID df2ae4bc74153228d5a72bbe1a46c3c7dcf8db87 # Parent 4048aa055411cfe67b73b95e2f6adefe5c17bfeb fix SSL connection issues on platforms with 32-bit off_t patch by Maxim Dounin diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h --- 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 --- 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, } - /* 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;