http: detect connect failure
authorFelix Fietkau <nbd@openwrt.org>
Sat, 16 Jan 2016 22:26:32 +0000 (23:26 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 16 Jan 2016 22:26:32 +0000 (23:26 +0100)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
uclient-http.c

index 3ffb88c001dfc4bd8d7219e87b898a2a03af398a..574dc0177a9d99054095a4d4aaf1d47428c5d6b6 100644 (file)
@@ -736,6 +736,10 @@ static void uclient_notify_state(struct ustream *us)
 {
        struct uclient_http *uh = container_of(us, struct uclient_http, ufd.stream);
 
+       if (uh->ufd.stream.write_error) {
+               uclient_http_error(uh, UCLIENT_ERROR_CONNECT);
+               return;
+       }
        uclient_notify_eof(uh);
 }