diff mbox series

[V2,5/7] Use swupdate_download_update in curl connections

Message ID 20201026140342.147578-5-sbabic@denx.de
State Accepted
Headers show
Series [V2,1/7] downloader: drop unuseful marker when dwl is started | expand

Commit Message

Stefano Babic Oct. 26, 2020, 2:03 p.m. UTC
This is called to signal the amount of transferred data.

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 corelib/channel_curl.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/corelib/channel_curl.c b/corelib/channel_curl.c
index a4e9a98..c95b6b3 100644
--- a/corelib/channel_curl.c
+++ b/corelib/channel_curl.c
@@ -23,6 +23,7 @@ 
 #include "sslapi.h"
 #include "channel.h"
 #include "channel_curl.h"
+#include "progress.h"
 #ifdef CONFIG_JSON
 #include <json-c/json.h>
 #endif
@@ -379,14 +380,7 @@  static int channel_callback_xferinfo(void *p, curl_off_t dltotal, curl_off_t dln
 		return 0;
 	}
 	*last_percent = percent;
-	char *info;
-	if (asprintf(&info,
-					"{\"percent\": %d, \"msg\":\"Received %" CURL_FORMAT_CURL_OFF_T "B "
-					"of %" CURL_FORMAT_CURL_OFF_T "B\"}",
-					(int)percent, dlnow, dltotal) != ENOMEM_ASPRINTF) {
-		notify(PROGRESS, RECOVERY_NO_ERROR, TRACELEVEL, info);
-		free(info);
-	}
+	swupdate_download_update(percent, dltotal);
 	return 0;
 }