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 1787cd036fe46875e00b70b7e2bf24836554cfb7..0d9633ac6767fdb765cd6c6d355d67c9134f81d1 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 41e69f70542b8d64f209925a045a1c3fc6e684a3..9a22ff0a1c4cfbd891b8b377b370cbb1f7f57919 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);
 }