From 5b141d2ef217ee8b49ede9489d784fbfa01baf5d Mon Sep 17 00:00:00 2001
From: Anthony Minessale <anthm@freeswitch.org>
Date: Fri, 9 Dec 2011 19:20:48 -0600
Subject: [PATCH] dont end on break events

---
 src/mod/endpoints/mod_rtmp/rtmp.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/mod/endpoints/mod_rtmp/rtmp.c b/src/mod/endpoints/mod_rtmp/rtmp.c
index 701487020e..3dc9e53f20 100644
--- a/src/mod/endpoints/mod_rtmp/rtmp.c
+++ b/src/mod/endpoints/mod_rtmp/rtmp.c
@@ -708,10 +708,14 @@ switch_status_t rtmp_handle_data(rtmp_session_t *rsession)
 	}  else if (rsession->state == RS_ESTABLISHED) {
 		/* Process RTMP packet */
 		switch(rsession->parse_state) {
+			switch_status_t rstatus;
+
 			case 0:
 				// Read the header's first byte
 				s = 1;
-				if (rsession->profile->io->read(rsession, (unsigned char*)buf, &s) != SWITCH_STATUS_SUCCESS) {
+				rstatus = rsession->profile->io->read(rsession, (unsigned char*)buf, &s);
+
+				if (rstatus != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(rstatus)) {
 					switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read error\n");
 					return SWITCH_STATUS_FALSE;
 				}