twister

HTTP fault injector for testing
Log | Files | Refs | README | LICENSE

commit c5a65df2f40125fdd7d35f29822038d0d93fc5b5
parent 0778f3286f4502e2ed3a962f745c1970fab664b3
Author: Marcello Stanisci <stanisci.m@gmail.com>
Date:   Fri,  1 Jun 2018 16:20:52 +0200

Tolerate download state not set.

Diffstat:
Msrc/twister/taler-twister-service.c | 13+++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/twister/taler-twister-service.c b/src/twister/taler-twister-service.c @@ -457,8 +457,17 @@ curl_download_cb (void *ptr, GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Curl download proceeding\n"); - GNUNET_assert - (REQUEST_STATE_DOWNLOAD_STARTED == hr->state); + + /* This condition holds when, for example, a Web + * server gives the response _before_ having received + * all the upload data, or no upload data at all. */ + if (REQUEST_STATE_DOWNLOAD_STARTED != hr->state) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Download prematurely started\n"); + hr->state = REQUEST_STATE_DOWNLOAD_STARTED; + } + if (hr->io_size - hr->io_len < total) {