mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-13 15:50:59 +00:00
different version of last commit
This commit is contained in:
parent
1be966ea01
commit
4b064aa96b
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user