ПРОЕКТЫ 


  АРХИВ 


Apache-Talk @lexa.ru 

Inet-Admins @info.east.ru 

Filmscanners @halftone.co.uk 

Security-alerts @yandex-team.ru 

nginx-ru @sysoev.ru 


  СТАТЬИ 


  ПЕРСОНАЛЬНОЕ 


  ПРОГРАММЫ 



ПИШИТЕ
ПИСЬМА












     АРХИВ :: nginx-ru
Nginx-ru mailing list archive (nginx-ru@sysoev.ru)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Upload модуль и таймауты



dimkalinux пишет:
Тестирую сейчас.

Но проблема существует.
Судя по логам, по локальной сети 15% закачек прерываются. При таймаутах
3 минуты. Можно ли сделать более подробное логирование прерванных закачек?

Можно сделать более подробное логгирование, не разлчиня прерванные и непрерваные загрузки. Вот патч.

--
Best regards,
Valery Kholodkov
diff --git a/ngx_http_upload_module.c b/ngx_http_upload_module.c
index cd60f29..9050ca2 100644
--- a/ngx_http_upload_module.c
+++ b/ngx_http_upload_module.c
@@ -3061,6 +3061,16 @@ ngx_http_process_request_body(ngx_http_request_t *r, 
ngx_chain_t *body)
 
     // Feed all the buffers into data handler
     while(body) {
+ 
+        ngx_log_debug7(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+                       "process request buf t:%d f:%d %p, pos %p, size: %z "
+                       "file: %O, size: %z",
+                       body->buf->temporary, body->buf->in_file,
+                       body->buf->start, body->buf->pos,
+                       body->buf->last - body->buf->pos,
+                       body->buf->file_pos,
+                       body->buf->file_last - body->buf->file_pos);
+
         rc = u->data_handler(u, body->buf->pos, body->buf->last);
 
         if(rc != NGX_OK)
@@ -3644,6 +3654,9 @@ static ngx_int_t upload_process_buf(ngx_http_upload_ctx_t 
*upload_ctx, u_char *s
                                        upload_ctx->state = 
upload_state_after_boundary;
                                        upload_ctx->boundary_start = 
upload_ctx->boundary.data;
                                        upload_ctx->boundary_pos = 
upload_ctx->boundary_start;
+
+                    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upload_ctx->log, 0,
+                                   "upload_state_after_boundary");
                                }
                                break;
                        case upload_state_after_boundary:
@@ -3651,6 +3664,9 @@ static ngx_int_t upload_process_buf(ngx_http_upload_ctx_t 
*upload_ctx, u_char *s
                                        case '\n':
                                                upload_ctx->state = 
upload_state_headers;
                         upload_ctx->header_accumulator_pos = 
upload_ctx->header_accumulator;
+
+                        ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upload_ctx->log, 0,
+                                       "upload_state_headers");
                                        case '\r':
                                                break;
                                        case '-':
@@ -3675,6 +3691,9 @@ static ngx_int_t upload_process_buf(ngx_http_upload_ctx_t 
*upload_ctx, u_char *s
                             } else {
                                 upload_ctx->state = upload_state_data;
                                 upload_ctx->output_buffer_pos = 
upload_ctx->output_buffer;     
+
+                                ngx_log_debug0(NGX_LOG_DEBUG_HTTP, 
upload_ctx->log, 0,
+                                               "upload_state_data");
                             }
                         } else {
                             *upload_ctx->header_accumulator_pos = '\0';
@@ -3739,6 +3758,9 @@ static ngx_int_t upload_process_buf(ngx_http_upload_ctx_t 
*upload_ctx, u_char *s
                                        upload_ctx->state = 
upload_state_after_boundary;
                                        upload_ctx->boundary_pos = 
upload_ctx->boundary_start;
 
+                    ngx_log_debug0(NGX_LOG_DEBUG_HTTP, upload_ctx->log, 0,
+                                   "upload_state_after_boundary");
+
                     upload_flush_output_buffer(upload_ctx);
                     if(!upload_ctx->discard_data)
                         upload_finish_file(upload_ctx);
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru


 




Copyright © Lexa Software, 1996-2009.