|
|
@@ -387,12 +387,12 @@ ngx_http_reportuploads_handler(ngx_http_request_t * r)
|
|
387
|
387
|
}
|
|
388
|
388
|
|
|
389
|
389
|
if (orig == NULL || orig->request_body == NULL) {
|
|
390
|
|
- if (up != NULL && up->err_status != NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
391
|
|
- size = sizeof("new Object({ 'state' : 'done' })\r\n");
|
|
392
|
|
- } else if (up != NULL && up->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
393
|
|
- size = sizeof("new Object({ 'state' : 'error', 'status' : 413 })\r\n");
|
|
394
|
|
- } else {
|
|
|
390
|
+ if (up == NULL ) {
|
|
395
|
391
|
size = sizeof("new Object({ 'state' : 'starting' })\r\n");
|
|
|
392
|
+ } else if (up != NULL && up->err_status >= NGX_HTTP_SPECIAL_RESPONSE) {
|
|
|
393
|
+ size = sizeof("new Object({ 'state' : 'error', 'status' : ") + NGX_INT_T_LEN + sizeof(" })\r\n");
|
|
|
394
|
+ } else {
|
|
|
395
|
+ size = sizeof("new Object({ 'state' : 'done' })\r\n");
|
|
396
|
396
|
}
|
|
397
|
397
|
} else if (orig->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
398
|
398
|
size = sizeof("new Object({ 'state' : 'error', 'status' : 413 })\r\n");
|
|
|
@@ -418,21 +418,20 @@ ngx_http_reportuploads_handler(ngx_http_request_t * r)
|
|
418
|
418
|
1);
|
|
419
|
419
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
420
|
420
|
"reportuploads returning starting");
|
|
421
|
|
- } else if (up != NULL && up->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
422
|
|
- b->last =
|
|
423
|
|
- ngx_cpymem(b->last,
|
|
424
|
|
- "new Object({ 'state' : 'error', 'status' : 413 })\r\n",
|
|
425
|
|
- sizeof
|
|
426
|
|
- ("new Object({ 'state' : 'error', 'status' : 413 })\r\n")
|
|
427
|
|
- - 1);
|
|
428
|
|
- ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
429
|
|
- "reportuploads returning error 413");
|
|
430
|
|
- } else {
|
|
|
421
|
+ } else if (up != NULL && up->err_status >= NGX_HTTP_SPECIAL_RESPONSE) {
|
|
|
422
|
+ b->last = ngx_cpymem(b->last, "new Object({ 'state' : 'error', 'status' : ",
|
|
|
423
|
+ sizeof("new Object({ 'state' : 'error', 'status' : ") - 1);
|
|
|
424
|
+ b->last = ngx_sprintf(b->last, "%ui })\r\n", up->err_status );
|
|
|
425
|
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
|
426
|
+ "reportuploads returning error condition: %ui", up->err_status);
|
|
|
427
|
+ }
|
|
|
428
|
+ else {
|
|
431
|
429
|
b->last = ngx_cpymem(b->last, "new Object({ 'state' : 'done' })\r\n",
|
|
432
|
|
- sizeof("new Object({ 'state' : 'done' })\r\n") - 1);
|
|
|
430
|
+ sizeof("new Object({ 'state' : 'done' })\r\n") -
|
|
|
431
|
+ 1);
|
|
433
|
432
|
ngx_log_debug0(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
434
|
433
|
"reportuploads returning done");
|
|
435
|
|
- }
|
|
|
434
|
+ }
|
|
436
|
435
|
} else if (orig->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
437
|
436
|
b->last =
|
|
438
|
437
|
ngx_cpymem(b->last,
|
|
|
@@ -445,7 +444,7 @@ ngx_http_reportuploads_handler(ngx_http_request_t * r)
|
|
445
|
444
|
} else {
|
|
446
|
445
|
b->last =
|
|
447
|
446
|
ngx_cpymem(b->last, "new Object({ 'state' : 'uploading', 'received' : ",
|
|
448
|
|
- sizeof("new Object({ 'state' : 'uploading', 'received' : ") -
|
|
|
447
|
+ sizeof("new Object({ 'state' : 'uploading', 'received' : ") -
|
|
449
|
448
|
1);
|
|
450
|
449
|
|
|
451
|
450
|
b->last =
|
|
|
@@ -795,7 +794,7 @@ ngx_http_uploadprogress_errortracker(ngx_http_request_t * r)
|
|
795
|
794
|
|
|
796
|
795
|
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
|
797
|
796
|
"uploadprogress error-tracker error: %D", r->err_status);
|
|
798
|
|
- if (r->err_status == NGX_HTTP_REQUEST_ENTITY_TOO_LARGE) {
|
|
|
797
|
+ if (r->err_status >= NGX_HTTP_SPECIAL_RESPONSE) {
|
|
799
|
798
|
|
|
800
|
799
|
upcf = ngx_http_get_module_loc_conf(r, ngx_http_uploadprogress_module);
|
|
801
|
800
|
|