From: Felix Fietkau Date: Tue, 18 Jun 2013 10:47:18 +0000 (+0200) Subject: consume all data after a socket write error X-Git-Url: http://git.openwrt.org/?p=project%2Fustream-ssl.git;a=commitdiff_plain;h=1b7e93768eb85930788894363a1b0580b03b269b consume all data after a socket write error Signed-off-by: Felix Fietkau --- diff --git a/ustream-io-cyassl.c b/ustream-io-cyassl.c index 1787cd0..0d9633a 100644 --- a/ustream-io-cyassl.c +++ b/ustream-io-cyassl.c @@ -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); } diff --git a/ustream-io-openssl.c b/ustream-io-openssl.c index 41e69f7..9a22ff0 100644 --- a/ustream-io-openssl.c +++ b/ustream-io-openssl.c @@ -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); }