Changeset 2131
- Timestamp:
- 03/20/2008 05:33:22 PM (6 months ago)
- Location:
- trunk
- Files:
-
- 23 modified
-
NEWS (modified) (1 diff)
-
src/connections.c (modified) (1 diff)
-
src/fdevent_poll.c (modified) (1 diff)
-
src/http-header-glue.c (modified) (1 diff)
-
src/http_req.c (modified) (2 diffs)
-
src/http_req_range_test.c (modified) (8 diffs)
-
src/lempar.c (modified) (4 diffs)
-
src/mod_accesslog.c (modified) (3 diffs)
-
src/mod_chunked.c (modified) (2 diffs)
-
src/mod_compress.c (modified) (2 diffs)
-
src/mod_deflate.c (modified) (8 diffs)
-
src/mod_postgresql_vhost.c (modified) (2 diffs)
-
src/mod_proxy_backend_ajp13.c (modified) (3 diffs)
-
src/mod_proxy_backend_fastcgi.c (modified) (1 diff)
-
src/mod_uploadprogress.c (modified) (1 diff)
-
src/network_gthread_aio.c (modified) (4 diffs)
-
src/network_gthread_sendfile.c (modified) (1 diff)
-
src/network_linux_sendfile.c (modified) (1 diff)
-
src/network_openssl.c (modified) (8 diffs)
-
src/network_posix_aio.c (modified) (4 diffs)
-
src/network_writev.c (modified) (1 diff)
-
src/request.c (modified) (1 diff)
-
src/server.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/NEWS
r2117 r2131 22 22 * mod_cgi: add a event-handler for STDERR_FILENO and log it with ERROR() 23 23 * fixed building/testing outside of the src dir 24 * fix many (64-bit) format warnings and unsigned/signed compare warnings 24 25 25 26 - 1.5.0-r19.. - -
trunk/src/connections.c
r2060 r2131 1339 1339 1340 1340 if (cq_len > 0) { 1341 TRACE("filter[%d] is not empty: % lld (report me)", f->id,cq_len);1341 TRACE("filter[%d] is not empty: %jd (report me)", f->id, (intmax_t) cq_len); 1342 1342 } 1343 1343 } -
trunk/src/fdevent_poll.c
r1827 r2131 117 117 if (ev->pollfds[ndx].revents & POLLNVAL) { 118 118 /* should never happen */ 119 SEGFAULT("ev->pollfds[% d].revents has POLLNVAL", ndx);119 SEGFAULT("ev->pollfds[%zu].revents has POLLNVAL", ndx); 120 120 } 121 121 -
trunk/src/http-header-glue.c
r1930 r2131 280 280 /* check if we can safely copy the string */ 281 281 if (used_len >= sizeof(buf)) { 282 TRACE("last-mod check failed as timestamp was too long: %s: % d, %d",282 TRACE("last-mod check failed as timestamp was too long: %s: %zu, %zu", 283 283 BUF_STR(http_if_modified_since->value), 284 284 used_len, sizeof(buf) - 1); -
trunk/src/http_req.c
r2060 r2131 158 158 t->is_key = 1; 159 159 } else { 160 ERROR("CR with out LF at pos: % d", t->offset);160 ERROR("CR with out LF at pos: %zu", t->offset); 161 161 return PARSER_ERROR; 162 162 } … … 185 185 t->offset == t->lookup_offset + 1) { 186 186 187 ERROR("invalid char (%d) at pos: % d", c, t->offset);187 ERROR("invalid char (%d) at pos: %zu", c, t->offset); 188 188 return PARSER_ERROR; 189 189 } -
trunk/src/http_req_range_test.c
r1496 r2131 2 2 #include <assert.h> 3 3 #include <string.h> 4 #include <stdint.h> 4 5 5 6 #include <tap.h> … … 18 19 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0"); 19 20 for (r = ranges; r; r = r->next) { 20 diag(".. % lld - %lld", r->start,r->end);21 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 21 22 } 22 23 http_request_range_reset(ranges); … … 25 26 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "1-2,3-4"); 26 27 for (r = ranges; r; r = r->next) { 27 diag(".. % lld - %lld", r->start,r->end);28 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 28 29 } 29 30 http_request_range_reset(ranges); … … 32 33 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "-0"); 33 34 for (r = ranges; r; r = r->next) { 34 diag(".. % lld - %lld", r->start,r->end);35 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 35 36 } 36 37 http_request_range_reset(ranges); … … 39 40 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-"); 40 41 for (r = ranges; r; r = r->next) { 41 diag(".. % lld - %lld", r->start,r->end);42 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 42 43 } 43 44 http_request_range_reset(ranges); … … 46 47 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0,0-"); 47 48 for (r = ranges; r; r = r->next) { 48 diag(".. % lld - %lld", r->start,r->end);49 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 49 50 } 50 51 http_request_range_reset(ranges); … … 53 54 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "0-0,-0"); 54 55 for (r = ranges; r; r = r->next) { 55 diag(".. % lld - %lld", r->start,r->end);56 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 56 57 } 57 58 http_request_range_reset(ranges); … … 60 61 ok(PARSE_SUCCESS == http_request_range_parse(b, ranges), "1-2,3-4,5-"); 61 62 for (r = ranges; r; r = r->next) { 62 diag(".. % lld - %lld", r->start,r->end);63 diag(".. %jd - %jd", (intmax_t) r->start, (intmax_t) r->end); 63 64 } 64 65 -
trunk/src/lempar.c
r2048 r2131 211 211 const char *ParseTokenName(int tokenType){ 212 212 #ifndef NDEBUG 213 if( tokenType>0 && (( unsigned int)tokenType)<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){213 if( tokenType>0 && ((size_t)tokenType)<(sizeof(yyTokenName)/sizeof(yyTokenName[0])) ){ 214 214 return yyTokenName[tokenType]; 215 215 }else{ … … 336 336 } 337 337 i += iLookAhead; 338 if( i<0 || ( unsigned int)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){338 if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 339 339 #ifdef YYFALLBACK 340 340 int iFallback; /* Fallback token */ … … 379 379 } 380 380 i += iLookAhead; 381 if( i<0 || ( unsigned int)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){381 if( i<0 || (size_t)i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ 382 382 return yy_default[stateno]; 383 383 }else{ … … 457 457 #ifndef NDEBUG 458 458 if( yyTraceFILE && yyruleno>=0 459 && ( unsigned int) yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){459 && (size_t) yyruleno<sizeof(yyRuleName)/sizeof(yyRuleName[0]) ){ 460 460 fprintf(yyTraceFILE, "%sReduce [%s].\n", yyTracePrompt, 461 461 yyRuleName[yyruleno]); -
trunk/src/mod_accesslog.c
r1916 r2131 343 343 # ifdef HAVE_SYSLOG_H 344 344 if (s->access_logbuffer->used > 2) { 345 syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 2, s->access_logbuffer->ptr);345 syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr); 346 346 } 347 347 # endif … … 547 547 if (s->access_logbuffer->used > 2) { 548 548 /* syslog appends a \n on its own */ 549 syslog(LOG_INFO, "%*s", s->access_logbuffer->used - 2, s->access_logbuffer->ptr);549 syslog(LOG_INFO, "%*s", (int) s->access_logbuffer->used - 2, s->access_logbuffer->ptr); 550 550 } 551 551 #endif … … 829 829 if (b->used > 2) { 830 830 /* syslog appends a \n on its own */ 831 syslog(LOG_INFO, "%*s", b->used - 2, b->ptr);831 syslog(LOG_INFO, "%*s", (int) b->used - 2, b->ptr); 832 832 } 833 833 #endif -
trunk/src/mod_chunked.c
r2060 r2131 203 203 } 204 204 if(con->response.content_length >= 0) { 205 if (p->conf.debug > 0) TRACE("response content length known, disabling chunked encoding. len=%j u",con->response.content_length);205 if (p->conf.debug > 0) TRACE("response content length known, disabling chunked encoding. len=%jd", (intmax_t) con->response.content_length); 206 206 use_chunked = 0; 207 207 } else if (con->request.http_method != HTTP_METHOD_HEAD) { … … 347 347 } 348 348 349 if (hctx->debug > 1) TRACE("chunk encoded: in=% lld, out=%lld", in->bytes_out,out->bytes_in);349 if (hctx->debug > 1) TRACE("chunk encoded: in=%jd, out=%jd", (intmax_t) in->bytes_out, (intmax_t) out->bytes_in); 350 350 351 351 chunkqueue_remove_finished_chunks(in); -
trunk/src/mod_compress.c
r2060 r2131 650 650 /* don't compress files that are too large as we need to much time to handle them */ 651 651 if (max_fsize && (sce->st.st_size >> 10) > max_fsize) { 652 if (con->conf.log_request_handling) TRACE("file '%s' is too large: %j u",652 if (con->conf.log_request_handling) TRACE("file '%s' is too large: %jd", 653 653 BUF_STR(con->physical.path), 654 sce->st.st_size);654 (intmax_t) sce->st.st_size); 655 655 656 656 return HANDLER_GO_ON; … … 659 659 /* compressing the file might lead to larger files instead */ 660 660 if (sce->st.st_size < 128) { 661 if (con->conf.log_request_handling) TRACE("file '%s' is too small: %j u",661 if (con->conf.log_request_handling) TRACE("file '%s' is too small: %jd", 662 662 BUF_STR(con->physical.path), 663 sce->st.st_size);663 (intmax_t) sce->st.st_size); 664 664 665 665 return HANDLER_GO_ON; -
trunk/src/mod_deflate.c
r2060 r2131 104 104 105 105 typedef struct { 106 int bytes_in;106 off_t bytes_in; 107 107 filter *fl; 108 108 chunkqueue *in; … … 360 360 buffer_copy_memory(hctx->output, gzip_header, sizeof(gzip_header)); 361 361 if(p->conf.debug) { 362 TRACE("gzip_header len=% i", sizeof(gzip_header));362 TRACE("gzip_header len=%zu", sizeof(gzip_header)); 363 363 } 364 364 /* initialize crc32 */ … … 753 753 off_t toSend; 754 754 stat_cache_entry *sce = NULL; 755 off_t we_want_to_mmap = 2 MByte;756 off_t we_want_to_send = st_size;755 size_t we_want_to_mmap = 2 MByte; 756 size_t we_want_to_send = st_size; 757 757 char *start = NULL; 758 758 … … 766 766 767 767 if (c->file.length + c->file.start > sce->st.st_size) { 768 ERROR("file '%s' was shrinked: was % lld, is %lld (%lld, %lld)",769 BUF_STR(c->file.name), c->file.length + c->file.start,sce->st.st_size,770 c->file.start,c->offset);768 ERROR("file '%s' was shrinked: was %ju, is %ju (%ju, %ju)", 769 BUF_STR(c->file.name), (intmax_t) c->file.length + c->file.start, (intmax_t) sce->st.st_size, 770 (intmax_t) c->file.start, (intmax_t) c->offset); 771 771 772 772 return -1; … … 812 812 c->file.mmap.offset = 0; 813 813 814 while (c->file.mmap.offset + we_want_to_mmap < c->file.start) {814 while (c->file.mmap.offset + (off_t) we_want_to_mmap < c->file.start) { 815 815 c->file.mmap.offset += we_want_to_mmap; 816 816 } … … 858 858 /* to_send = abs_mmap_end - abs_offset */ 859 859 toSend = (c->file.mmap.offset + c->file.mmap.length) - (abs_offset); 860 if (toSend >we_want_to_send) toSend = we_want_to_send;860 if (toSend > (off_t) we_want_to_send) toSend = we_want_to_send; 861 861 862 862 if (toSend < 0) { … … 898 898 899 899 if(p->conf.debug && hctx->bytes_in < hctx->out->bytes_in) { 900 TRACE("compressing uri '%s' increased the sent content-size from % i to %lld",901 BUF_STR(con->uri.path_raw), hctx->bytes_in,hctx->out->bytes_in);900 TRACE("compressing uri '%s' increased the sent content-size from %jd to %jd", 901 BUF_STR(con->uri.path_raw), (intmax_t) hctx->bytes_in, (intmax_t) hctx->out->bytes_in); 902 902 } 903 903 … … 1012 1012 1013 1013 if (p->conf.debug) { 1014 TRACE("end: %d - % lld - %lld", hctx->in->is_closed, hctx->in->bytes_in,hctx->in->bytes_out);1014 TRACE("end: %d - %jd - %jd", hctx->in->is_closed, (intmax_t) hctx->in->bytes_in, (intmax_t) hctx->in->bytes_out); 1015 1015 } 1016 1016 -
trunk/src/mod_postgresql_vhost.c
r1756 r2131 220 220 gchar *field; 221 221 222 UNUSED(host); 223 222 224 /* no host specified? */ 223 225 if (buffer_is_empty(con->uri.authority)) return HANDLER_ERROR; … … 259 261 260 262 if (PQstatus(p->conf.conn) != CONNECTION_OK){ 261 ERROR("PQconnectdb() failed: % s", PQstatus(p->conf.conn));263 ERROR("PQconnectdb() failed: %i", PQstatus(p->conf.conn)); 262 264 263 265 PQfinish(p->conf.conn); -
trunk/src/mod_proxy_backend_ajp13.c
r2060 r2131 282 282 len = ajp13_decode_int(data); 283 283 if ((ssize_t)len == -1) { 284 ERROR("ajp13_decode_int() returned invalid len: % d", len);284 ERROR("ajp13_decode_int() returned invalid len: %zu", len); 285 285 return len; 286 286 } 287 287 #ifdef AJP13_DEBUG 288 TRACE("ajp13_decode_string() string-len: % d (is_header: %d, common-header: %d)", len, is_header, (len & AJP13_COMMON_HEADER_CODE));288 TRACE("ajp13_decode_string() string-len: %zu (is_header: %d, common-header: %zd)", len, is_header, (len & AJP13_COMMON_HEADER_CODE)); 289 289 #endif 290 290 … … 295 295 len = strlen(p); 296 296 } else { 297 ERROR("ajp13_decode_string() can't resolve common-header: % d", len & ~AJP13_COMMON_HEADER_CODE);297 ERROR("ajp13_decode_string() can't resolve common-header: %zd", len & ~AJP13_COMMON_HEADER_CODE); 298 298 299 299 return -1; … … 303 303 if (p == NULL) { 304 304 if ((data->buf->used - data->offset) <= (len + 1)) { 305 ERROR("we have %j u bytes, but a partial-string wants %zu. no way",(data->buf->used - data->offset), len);305 ERROR("we have %jd bytes, but a partial-string wants %zu. no way", (intmax_t) (data->buf->used - data->offset), len); 306 306 return -1; 307 307 } -
trunk/src/mod_proxy_backend_fastcgi.c
r2060 r2131 480 480 out->is_closed = 1; 481 481 482 TRACE("%j u / %ju-> %d",483 in->bytes_in,in->bytes_out,482 TRACE("%jd / %jd -> %d", 483 (intmax_t) in->bytes_in, (intmax_t) in->bytes_out, 484 484 in->is_closed); 485 485 -
trunk/src/mod_uploadprogress.c
r2060 r2131 260 260 261 261 if (b->used != 32 + 1) { 262 if (p->conf.debug) ERROR("the Progress-ID has to be 32 characters long, got % d characters", b->used - 1);262 if (p->conf.debug) ERROR("the Progress-ID has to be 32 characters long, got %zd characters", b->used - 1); 263 263 return NULL; 264 264 } -
trunk/src/network_gthread_aio.c
r2060 r2131 250 250 251 251 /* check which chunks are finished now */ 252 for (tc = c; tc; tc = tc->next) { 253 /* finished the chunk */ 254 if (tc->offset == tc->mem->used - 1) { 255 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 256 if (chunk_finished) { 257 c = c->next; 258 } else { 259 chunk_finished = 1; 260 } 252 for (tc = c; tc && chunk_is_done(tc); tc = tc->next) { 253 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 254 if (chunk_finished) { 255 c = c->next; 261 256 } else { 262 break;257 chunk_finished = 1; 263 258 } 264 259 } … … 386 381 return NETWORK_STATUS_FATAL_ERROR; 387 382 } else if (r != c->file.copy.length) { 388 ERROR("read() returned % d instead of %ju", r,c->file.copy.length);383 ERROR("read() returned %zd instead of %jd", r, (intmax_t) c->file.copy.length); 389 384 390 385 return NETWORK_STATUS_FATAL_ERROR; … … 421 416 return NETWORK_STATUS_CONNECTION_CLOSE; 422 417 default: 423 ERROR("write failed: %d (%s) [%lld, %p, %lld]", 424 errno, strerror(errno), c->file.copy.length, c->file.mmap.start, c->file.copy.offset); 418 ERROR("write failed: %d (%s) [%jd, %p, %jd]", 419 errno, strerror(errno), (intmax_t) c->file.copy.length, 420 c->file.mmap.start, (intmax_t) c->file.copy.offset); 425 421 return NETWORK_STATUS_FATAL_ERROR; 426 422 } … … 436 432 cq->bytes_out += r; 437 433 438 if (c->file. mmap.length == c->file.copy.offset) {434 if (c->file.copy.offset == (off_t) c->file.mmap.length) { 439 435 /* this block is sent, get a new one */ 440 436 timing_log(srv, con, TIME_SEND_WRITE_END); -
trunk/src/network_gthread_sendfile.c
r2060 r2131 170 170 171 171 /* check which chunks are finished now */ 172 for (tc = c; tc; tc = tc->next) { 173 /* finished the chunk */ 174 if (tc->offset == tc->mem->used - 1) { 175 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 176 if (chunk_finished) { 177 c = c->next; 178 } else { 179 chunk_finished = 1; 180 } 172 for (tc = c; tc && chunk_is_done(tc); tc = tc->next) { 173 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 174 if (chunk_finished) { 175 c = c->next; 181 176 } else { 182 break;177 chunk_finished = 1; 183 178 } 184 179 } -
trunk/src/network_linux_sendfile.c
r1697 r2131 45 45 46 46 /* check which chunks are finished now */ 47 for (tc = c; tc; tc = tc->next) { 48 /* finished the chunk */ 49 if (tc->offset == tc->mem->used - 1) { 50 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 51 if (chunk_finished) { 52 c = c->next; 53 } else { 54 chunk_finished = 1; 55 } 47 for (tc = c; tc && chunk_is_done(tc); tc = tc->next) { 48 /* skip the first c->next as that will be done by the c = c->next in the other for()-loop */ 49 if (chunk_finished) { 50 c = c->next; 56 51 } else { 57
