Revert "Remove heartbeats completely"
[oweals/openssl.git] / apps / s_server.c
index 88cbf9f8c19ec806ed542f436547803f7c09c543..ee6631809c16e827ce45c91cbff96ec2bf82e81f 100644 (file)
@@ -2226,6 +2226,14 @@ static int sv_body(int s, int stype, unsigned char *context)
                      */
                     goto err;
                 }
+#ifndef OPENSSL_NO_HEARTBEATS
+                if ((buf[0] == 'B') && ((buf[1] == '\n') || (buf[1] == '\r'))) {
+                    BIO_printf(bio_err, "HEARTBEATING\n");
+                    SSL_heartbeat(con);
+                    i = 0;
+                    continue;
+                }
+#endif
                 if ((buf[0] == 'r') && ((buf[1] == '\n') || (buf[1] == '\r'))) {
                     SSL_renegotiate(con);
                     i = SSL_do_handshake(con);