Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added detection of HTTP 413 errors

Addition of a header filter to track HTTP errors and return
the right status to upload progress probes.
  • Loading branch information...
commit 004131f4047aea7c71c60df0d2ab1bb772595d93 1 parent e9ccdcd
@masterzen authored
Showing with 12 additions and 4 deletions.
  1. +1 −1  config
  2. +11 −3 ngx_http_uploadprogress_module.c
View
2  config
@@ -1,3 +1,3 @@
ngx_addon_name=ngx_http_uploadprogress_module
-HTTP_MODULES="$HTTP_MODULES ngx_http_uploadprogress_module"
+HTTP_FILTER_MODULES="$HTTP_FILTER_MODULES ngx_http_uploadprogress_module"
NGX_ADDON_SRCS="$NGX_ADDON_SRCS $ngx_addon_dir/ngx_http_uploadprogress_module.c"
View
14 ngx_http_uploadprogress_module.c
@@ -773,8 +773,8 @@ ngx_http_uploadprogress_errortracker(ngx_http_request_t *r)
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
if (!upcf->track) {
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "uploadprogress error-tracker not tracking in this location for id: %V", id);
+ ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "uploadprogress error-tracker not tracking in this location");
goto finish;
}
@@ -854,9 +854,17 @@ ngx_http_uploadprogress_errortracker(ngx_http_request_t *r)
upcln->shm_zone = upcf->shm_zone;
upcln->node = node;
+ /* start the timer if needed */
+ if ( !upcf->cleanup.timer_set)
+ {
+ upcf->cleanup.data = upcf->shm_zone;
+ upcf->cleanup.handler = ngx_clean_old_connections;
+ upcf->cleanup.log = r->connection->log;
+ ngx_add_timer(&upcf->cleanup, 60 * 1000);
+ }
+
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"trackuploads error-tracking adding: %08XD", node->key);
-
}
finish:
Please sign in to comment.
Something went wrong with that request. Please try again.