From 754ca1bbb0d59a0d2873bb1996307cd92bbf2238 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 28 Jul 2014 13:58:02 +0200 Subject: [PATCH] uclient-http: only invoke data_sent callback if it is provided Signed-off-by: Jo-Philipp Wich --- uclient-http.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/uclient-http.c b/uclient-http.c index 4633956..1569cda 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -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) -- 2.25.1