fix sendfile on 64-bit Linux and limit_rate on all 64-bit platforms

for 2G+ files
This commit is contained in:
Igor Sysoev 2007-04-23 21:32:13 +00:00
parent 29f5912635
commit 57a713c67c
3 changed files with 3 additions and 3 deletions

View File

@ -154,7 +154,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
size = limit - send;
aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
& ~(ngx_pagesize - 1);
& ~((off_t) ngx_pagesize - 1);
if (aligned <= cl->buf->file_last) {
size = aligned - cl->buf->file_pos;

View File

@ -223,7 +223,7 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
size = limit - send;
aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
& ~(ngx_pagesize - 1);
& ~((off_t) ngx_pagesize - 1);
if (aligned <= cl->buf->file_last) {
size = aligned - cl->buf->file_pos;

View File

@ -135,7 +135,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
size = limit - send;
aligned = (cl->buf->file_pos + size + ngx_pagesize - 1)
& ~(ngx_pagesize - 1);
& ~((off_t) ngx_pagesize - 1);
if (aligned <= cl->buf->file_last) {
size = aligned - cl->buf->file_pos;