]> git.kaiwu.me - nginx.git/commitdiff
fix sendfile on 64-bit Linux and limit_rate on all 64-bit platforms
authorIgor Sysoev <igor@sysoev.ru>
Mon, 23 Apr 2007 21:32:13 +0000 (21:32 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 23 Apr 2007 21:32:13 +0000 (21:32 +0000)
for 2G+ files

src/os/unix/ngx_freebsd_sendfile_chain.c
src/os/unix/ngx_linux_sendfile_chain.c
src/os/unix/ngx_solaris_sendfilev_chain.c

index 97f968c40b6c110a4700cf4ee1ca715008c848c8..476eff332f91da4339752a7d2f062eef5d0ebce0 100644 (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;
index 1d602c8868a6ad23e6a992a3092bc03346bb46f1..eb15c7a5f8d39cf6d8d41d9db4d9c920876bc9e6 100644 (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;
index ebccae8faa6e088d0e168fdc1dab5ffd3f6467cf..04e33666aafffe8dfccfac9e4d8fc6f99d207c97 100644 (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;