From 1b7e93768eb85930788894363a1b0580b03b269b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 18 Jun 2013 12:47:18 +0200 Subject: [PATCH] consume all data after a socket write error Signed-off-by: Felix Fietkau --- ustream-io-cyassl.c | 3 +++ ustream-io-openssl.c | 3 +++ 2 files changed, 6 insertions(+) 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); } -- 2.30.2