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 61d13f3e0a5705cb6b3d8afcd76934688b1bbd90..e46376db4ce47716f036d8899682a15e39dcd16c 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;
             }