PR: 2658
Submitted by: Robin Seggelmann <seggelmann@fh-muenster.de>
Reviewed by: steve

Support for TLS/DTLS heartbeats.
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index 4999f01..e205b5c 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -424,6 +424,14 @@
 		state->timeout.read_timeouts = 1;
 		}
 
+#ifndef OPENSSL_NO_HEARTBEATS
+	if (s->tlsext_hb_pending)
+		{
+		s->tlsext_hb_pending = 0;
+		return dtls1_heartbeat(s);
+		}
+#endif
+
 	dtls1_start_timer(s);
 	return dtls1_retransmit_buffered_messages(s);
 	}