[rtmpdump] r148 - in trunk: hashswf.c rtmp.c rtmpsrv.c streams.c
hyc
subversion at mplayerhq.hu
Thu Dec 31 03:30:55 CET 2009
Author: hyc
Date: Thu Dec 31 03:30:54 2009
New Revision: 148
Log:
More cleanup
Modified:
trunk/hashswf.c
trunk/rtmp.c
trunk/rtmpsrv.c
trunk/streams.c
Modified: trunk/hashswf.c
==============================================================================
--- trunk/hashswf.c Thu Dec 31 03:01:02 2009 (r147)
+++ trunk/hashswf.c Thu Dec 31 03:30:54 2009 (r148)
@@ -93,7 +93,7 @@ http_get(const char *url, struct info *i
char hbuf[256];
int port = 80;
int ssl = 0;
- int hlen, flen;
+ int hlen, flen = 0;
int rc, i, ret = 0;
struct sockaddr_in sa;
RTMPSockBuf sb;
@@ -223,12 +223,10 @@ http_get(const char *url, struct info *i
}
}
- while (sb.sb_size > 0 || RTMPSockBuf_Fill(&sb) > 0)
+ while (flen > 0 && (sb.sb_size > 0 || RTMPSockBuf_Fill(&sb) > 0))
{
swfcrunch(sb.sb_start, 1, sb.sb_size, in);
flen -= sb.sb_size;
- if (flen < 1)
- break;
sb.sb_size = 0;
}
Modified: trunk/rtmp.c
==============================================================================
--- trunk/rtmp.c Thu Dec 31 03:01:02 2009 (r147)
+++ trunk/rtmp.c Thu Dec 31 03:30:54 2009 (r148)
@@ -2290,7 +2290,7 @@ RTMP_Close(RTMP * r)
int i;
if (RTMP_IsConnected(r))
- close(r->m_socket);
+ closesocket(r->m_socket);
r->m_stream_id = -1;
r->m_socket = 0;
Modified: trunk/rtmpsrv.c
==============================================================================
--- trunk/rtmpsrv.c Thu Dec 31 03:01:02 2009 (r147)
+++ trunk/rtmpsrv.c Thu Dec 31 03:30:54 2009 (r148)
@@ -633,7 +633,7 @@ startStreaming(const char *address, int
if (listen(sockfd, 10) == -1)
{
Log(LOGERROR, "%s, listen failed", __FUNCTION__);
- close(sockfd);
+ closesocket(sockfd);
return 0;
}
@@ -661,7 +661,7 @@ stopStreaming(STREAMING_SERVER * server)
msleep(1);
}
- if (close(server->socket))
+ if (closesocket(server->socket))
Log(LOGERROR, "%s: Failed to close listening socket, error %d",
GetSockError());
Modified: trunk/streams.c
==============================================================================
--- trunk/streams.c Thu Dec 31 03:01:02 2009 (r147)
+++ trunk/streams.c Thu Dec 31 03:30:54 2009 (r148)
@@ -507,7 +507,7 @@ void processTCPrequest(STREAMING_SERVER
}
else
{
- nRead = read(sockfd, header, 2047);
+ nRead = recv(sockfd, header, 2047, 0);
header[2047] = '\0';
Log(LOGDEBUG, "%s: header: %s", __FUNCTION__, header);
@@ -783,7 +783,7 @@ quit:
}
if (sockfd)
- close(sockfd);
+ closesocket(sockfd);
if (server->state == STREAMING_IN_PROGRESS)
server->state = STREAMING_ACCEPTING;
@@ -855,7 +855,7 @@ startStreaming(const char *address, int
if (listen(sockfd, 10) == -1)
{
Log(LOGERROR, "%s, listen failed", __FUNCTION__);
- close(sockfd);
+ closesocket(sockfd);
return 0;
}
@@ -883,7 +883,7 @@ stopStreaming(STREAMING_SERVER * server)
msleep(1);
}
- if (close(server->socket))
+ if (closesocket(server->socket))
Log(LOGERROR, "%s: Failed to close listening socket, error %d",
GetSockError());
More information about the rtmpdump
mailing list