diff --git a/netutils/webclient/webclient.c b/netutils/webclient/webclient.c index 73c18dc07..539c7a8b8 100644 --- a/netutils/webclient/webclient.c +++ b/netutils/webclient/webclient.c @@ -982,7 +982,11 @@ int webclient_perform(FAR struct webclient_context *ctx) * received file. */ - if (ctx->sink_callback) + if (ws->offset == ws->datend) + { + /* We don't have data to give to the client yet. */ + } + else if (ctx->sink_callback) { ret = ctx->sink_callback(&ws->buffer, ws->offset, ws->datend, &ws->buflen,