uclient-http: only invoke data_sent callback if it is provided
authorJo-Philipp Wich <jow@openwrt.org>
Mon, 28 Jul 2014 11:58:02 +0000 (13:58 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 4 Sep 2014 10:46:11 +0000 (12:46 +0200)
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
uclient-http.c

index 4633956e63519e637749e9a82efb195f34eb6a4d..1569cda34aa6c3e4167fac4f38137c8da6d4ee90 100644 (file)
@@ -657,7 +657,9 @@ static void __uclient_notify_read(struct uclient_http *uh)
 static void __uclient_notify_write(struct uclient_http *uh)
 {
        struct uclient *uc = &uh->uc;
-       uc->cb->data_sent(uc);
+
+       if (uc->cb->data_sent)
+               uc->cb->data_sent(uc);
 }
 
 static void uclient_notify_read(struct ustream *us, int bytes)