Don't add write errors into bytecounts
[openssl.git] / 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;
             }