From 0e17b006750bc39b15dcb2eef0cae24d424aeea2 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Thu, 19 Sep 2013 12:40:17 +0200 Subject: [PATCH] Added a new error code HBF_TRANSFER_NOT_ACKED. If the server does not acknowledge the transfer with sending back an ETag after the last missing chunk was uploaded, this is an error which is now reported by this new error type. --- src/httpbf/src/httpbf.c | 14 +++++++++++++- src/httpbf/src/httpbf.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/httpbf/src/httpbf.c b/src/httpbf/src/httpbf.c index 19de194d34..36b2c0ff0d 100644 --- a/src/httpbf/src/httpbf.c +++ b/src/httpbf/src/httpbf.c @@ -505,6 +505,10 @@ Hbf_State hbf_transfer( ne_session *session, hbf_transfer_t *transfer, const cha /* do the source file validation finally (again). */ if( state == HBF_SUCCESS ) { state = validate_source_file(transfer); + } else if( state == HBF_TRANSFER_SUCCESS ) { + /* This means that no etag was returned on one of the chunks to indicate + * that the upload was finished. */ + state = HBF_TRANSFER_NOT_ACKED; } return state; @@ -574,10 +578,18 @@ const char *hbf_error_string(hbf_transfer_t *transfer, Hbf_State state) case HBF_MEMORY_FAIL: re = "Out of memory."; break; + case HBF_STAT_FAIL: + re = "Filesystem stat on file failed."; + break; case HBF_SOURCE_FILE_CHANGE: re = "Source file changed too often during upload."; break; - + case HBF_USER_ABORTED: + re = "Transmission aborted by user."; + break; + case HBF_TRANSFER_NOT_ACKED: + re = "The server did not provide an Etag."; + break; case HBF_FAIL: default: for( cnt = 0; cnt < transfer->block_cnt; cnt++ ) { diff --git a/src/httpbf/src/httpbf.h b/src/httpbf/src/httpbf.h index 5442ca0bac..c315b55d76 100644 --- a/src/httpbf/src/httpbf.h +++ b/src/httpbf/src/httpbf.h @@ -50,6 +50,7 @@ enum hbf_state_e { HBF_STAT_FAIL, HBF_SOURCE_FILE_CHANGE, HBF_USER_ABORTED, + HBF_TRANSFER_NOT_ACKED, HBF_FAIL };