]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
different version of last commit
authorAnthony Minessale <anthm@freeswitch.org>
Sat, 10 Dec 2011 13:40:40 +0000 (07:40 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Sat, 10 Dec 2011 13:40:46 +0000 (07:40 -0600)
src/mod/endpoints/mod_rtmp/rtmp.c
src/mod/endpoints/mod_rtmp/rtmp_tcp.c
src/switch_apr.c

index 3dc9e53f2066488ed0cb978bd9b201d7690f4585..701487020e690ed9a92182fff3094493632450a2 100644 (file)
@@ -708,14 +708,10 @@ 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;
-                               rstatus = rsession->profile->io->read(rsession, (unsigned char*)buf, &s);
-
-                               if (rstatus != SWITCH_STATUS_SUCCESS && !SWITCH_STATUS_IS_BREAK(rstatus)) {
+                               if (rsession->profile->io->read(rsession, (unsigned char*)buf, &s) != SWITCH_STATUS_SUCCESS) {
                                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Read error\n");
                                        return SWITCH_STATUS_FALSE;
                                }
index 239a358dcf498b5bc5c483deb072dd3693a2b2a1..7d4bbd5465c9b8e5ff490ffa975b49bc3de7260e 100644 (file)
@@ -85,7 +85,10 @@ static switch_status_t rtmp_tcp_read(rtmp_session_t *rsession, unsigned char *bu
        switch_size_t olen = *len;
 #endif 
        switch_assert(*len > 0 && *len < 1024000);
-       status = switch_socket_recv(io_pvt->socket, (char*)buf, len);   
+
+       do {
+               status = switch_socket_recv(io_pvt->socket, (char*)buf, len);   
+       } while(status != SWITCH_STATUS_SUCCESS && SWITCH_STATUS_IS_BREAK(status));
        
 #ifdef RTMP_DEBUG_IO
        {
index d19d3ccd504f8db1d109aa0b43e453326e4a6233..7d98ec69efc8f130c60807a2555887a997841574 100644 (file)
@@ -750,7 +750,15 @@ SWITCH_DECLARE(switch_status_t) switch_socket_sendto(switch_socket_t *sock, swit
 
 SWITCH_DECLARE(switch_status_t) switch_socket_recv(switch_socket_t *sock, char *buf, switch_size_t *len)
 {
-       return apr_socket_recv(sock, buf, len);
+       switch_status_t r;
+
+       r = apr_socket_recv(sock, buf, len);
+
+       if (r == 35 || r == 730035) {
+               r = SWITCH_STATUS_BREAK;
+       }
+
+       return r;
 }
 
 SWITCH_DECLARE(switch_status_t) switch_sockaddr_create(switch_sockaddr_t **sa, switch_memory_pool_t *pool)