consume all data after a socket write error
authorFelix Fietkau <nbd@openwrt.org>
Tue, 18 Jun 2013 10:47:18 +0000 (12:47 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 18 Jun 2013 10:47:20 +0000 (12:47 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
ustream-io-cyassl.c
ustream-io-openssl.c

index 1787cd0..0d9633a 100644 (file)
@@ -58,6 +58,9 @@ static int s_ustream_write(char *buf, int len, void *ctx)
 {
        struct ustream *s = ctx;
 
+       if (s->write_error)
+               return len;
+
        return ustream_write(s, buf, len, false);
 }
 
index 41e69f7..9a22ff0 100644 (file)
@@ -88,6 +88,9 @@ s_ustream_write(BIO *b, const char *buf, int len)
        if (!s)
                return 0;
 
+       if (s->write_error)
+               return len;
+
        return ustream_write(s, buf, len, false);
 }