Don't add write errors into bytecounts
authorRobert Swiecki <robert@swiecki.net>
Mon, 18 May 2015 23:08:02 +0000 (19:08 -0400)
committerRich Salz <rsalz@openssl.org>
Tue, 19 May 2015 11:19:38 +0000 (07:19 -0400)
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
apps/s_server.c

index 61d13f3..e46376d 100644 (file)
@@ -2290,8 +2290,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context)
                     ret = 1;
                     goto err;
                 }
-                l += k;
-                i -= k;
+                if (k > 0) {
+                    l += k;
+                    i -= k;
+                }
                 if (i <= 0)
                     break;
             }