comparison src/http/ngx_http_request.c @ 6480:f01ab2dbcfdc

Fixed logging.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 31 Mar 2016 02:33:57 +0300
parents 4ba91a4c66a3
children f7849bfb6d21 f88a145b093e
comparison
equal deleted inserted replaced
6479:dc92298b1852 6480:f01ab2dbcfdc
646 646
647 n = recv(c->fd, (char *) buf, size, MSG_PEEK); 647 n = recv(c->fd, (char *) buf, size, MSG_PEEK);
648 648
649 err = ngx_socket_errno; 649 err = ngx_socket_errno;
650 650
651 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http recv(): %d", n); 651 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, rev->log, 0, "http recv(): %z", n);
652 652
653 if (n == -1) { 653 if (n == -1) {
654 if (err == NGX_EAGAIN) { 654 if (err == NGX_EAGAIN) {
655 rev->ready = 0; 655 rev->ready = 0;
656 656
1498 1498
1499 return NGX_OK; 1499 return NGX_OK;
1500 } 1500 }
1501 1501
1502 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 1502 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
1503 "http large header copy: %d", r->header_in->pos - old); 1503 "http large header copy: %uz", r->header_in->pos - old);
1504 1504
1505 new = b->start; 1505 new = b->start;
1506 1506
1507 ngx_memcpy(new, old, r->header_in->pos - old); 1507 ngx_memcpy(new, old, r->header_in->pos - old);
1508 1508
2262 ngx_http_core_loc_conf_t *clcf; 2262 ngx_http_core_loc_conf_t *clcf;
2263 2263
2264 c = r->connection; 2264 c = r->connection;
2265 2265
2266 ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0, 2266 ngx_log_debug5(NGX_LOG_DEBUG_HTTP, c->log, 0,
2267 "http finalize request: %d, \"%V?%V\" a:%d, c:%d", 2267 "http finalize request: %i, \"%V?%V\" a:%d, c:%d",
2268 rc, &r->uri, &r->args, r == c->data, r->main->count); 2268 rc, &r->uri, &r->args, r == c->data, r->main->count);
2269 2269
2270 if (rc == NGX_DONE) { 2270 if (rc == NGX_DONE) {
2271 ngx_http_finalize_connection(r); 2271 ngx_http_finalize_connection(r);
2272 return; 2272 return;
2954 } else { 2954 } else {
2955 b->pos = b->start; 2955 b->pos = b->start;
2956 b->last = b->start; 2956 b->last = b->start;
2957 } 2957 }
2958 2958
2959 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %d", 2959 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc free: %p %i",
2960 hc->free, hc->nfree); 2960 hc->free, hc->nfree);
2961 2961
2962 if (hc->free) { 2962 if (hc->free) {
2963 for (i = 0; i < hc->nfree; i++) { 2963 for (i = 0; i < hc->nfree; i++) {
2964 ngx_pfree(c->pool, hc->free[i]->start); 2964 ngx_pfree(c->pool, hc->free[i]->start);
2966 } 2966 }
2967 2967
2968 hc->nfree = 0; 2968 hc->nfree = 0;
2969 } 2969 }
2970 2970
2971 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %d", 2971 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0, "hc busy: %p %i",
2972 hc->busy, hc->nbusy); 2972 hc->busy, hc->nbusy);
2973 2973
2974 if (hc->busy) { 2974 if (hc->busy) {
2975 for (i = 0; i < hc->nbusy; i++) { 2975 for (i = 0; i < hc->nbusy; i++) {
2976 ngx_pfree(c->pool, hc->busy[i]->start); 2976 ngx_pfree(c->pool, hc->busy[i]->start);
3257 } 3257 }
3258 3258
3259 do { 3259 do {
3260 n = c->recv(c, buffer, NGX_HTTP_LINGERING_BUFFER_SIZE); 3260 n = c->recv(c, buffer, NGX_HTTP_LINGERING_BUFFER_SIZE);
3261 3261
3262 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "lingering read: %d", n); 3262 ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0, "lingering read: %z", n);
3263 3263
3264 if (n == NGX_ERROR || n == 0) { 3264 if (n == NGX_ERROR || n == 0) {
3265 ngx_http_close_request(r, 0); 3265 ngx_http_close_request(r, 0);
3266 return; 3266 return;
3267 } 3267 }