diff options
author | Doubango Telecom <github@doubango.org> | 2016-08-02 16:31:08 +0200 |
---|---|---|
committer | Doubango Telecom <github@doubango.org> | 2016-08-02 16:31:08 +0200 |
commit | 6f5bd675fd67732ce19912a1c78b617c3a224a47 (patch) | |
tree | 083e2e37f655fa29aeb1a14165b8cfaa0ef3252d | |
parent | 4c28e58c527f3b76f08178b12fcd2e306cee307d (diff) | |
parent | 5478d062b85a2eaf719981a992bf570161699dee (diff) | |
download | doubango-6f5bd675fd67732ce19912a1c78b617c3a224a47.zip doubango-6f5bd675fd67732ce19912a1c78b617c3a224a47.tar.gz |
Merge branch 'master' of https://github.com/DoubangoTelecom/doubango
-rwxr-xr-x | Building_Source_v2_0.md | 6 | ||||
-rwxr-xr-x | tinyNET/src/tnet_transport_cfsocket.c | 52 |
2 files changed, 29 insertions, 29 deletions
diff --git a/Building_Source_v2_0.md b/Building_Source_v2_0.md index 9475da0..8b7504f 100755 --- a/Building_Source_v2_0.md +++ b/Building_Source_v2_0.md @@ -11,7 +11,7 @@ sudo yum install make libtool autoconf subversion git wget libogg-devel gcc gcc- The first step is to checkout Doubango 2.0 source code: ``` -svn checkout https://doubango.googlecode.com/svn/branches/2.0/doubango doubango +git clone https://github.com/DoubangoTelecom/doubango.git ``` ### Building libsrtp ### @@ -188,7 +188,7 @@ make && make install ``` git clone https://github.com/cisco/openh264.git cd openh264 -git checkout v1.1 +git checkout v1.5.0 make ENABLE64BIT=Yes # Use ENABLE64BIT=No for 32bit platforms make install ``` @@ -211,4 +211,4 @@ make && make install ``` <br /> -Et voilĂ
\ No newline at end of file +Et voilĂ diff --git a/tinyNET/src/tnet_transport_cfsocket.c b/tinyNET/src/tnet_transport_cfsocket.c index 5ffe88d..b66c3b3 100755 --- a/tinyNET/src/tnet_transport_cfsocket.c +++ b/tinyNET/src/tnet_transport_cfsocket.c @@ -644,8 +644,10 @@ int removeSocketAtIndex(int index, transport_context_t *context) tnet_fd_t fd = sock->fd; // Remove from runloop - if (context->cf_run_loop && sock->cf_run_loop_source) { - CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes); + if (sock->cf_run_loop_source) { + if (context->cf_run_loop) { + CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopCommonModes); + } CFRelease(sock->cf_run_loop_source), sock->cf_run_loop_source = NULL; } @@ -1299,33 +1301,31 @@ void *tnet_transport_mainthread(void *param) } } - // Remove all the sockets, streams and sources from the run loop - tsk_safeobj_lock(context); - for(i = 0; i < context->count; i++) { - transport_context_t *context = transport->context; - transport_socket_xt *sock = context->sockets[i]; - - if (!sock) { - continue; - } - if (sock->cf_run_loop_source) { - CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopDefaultMode); - } - if (sock->cf_read_stream) { - //CFReadStreamClose(sock->cf_read_stream); - CFReadStreamUnscheduleFromRunLoop(sock->cf_read_stream, context->cf_run_loop, kCFRunLoopDefaultMode); - } - if (sock->cf_write_stream) { - //CFWriteStreamClose(sock->cf_write_stream); - CFWriteStreamUnscheduleFromRunLoop(sock->cf_write_stream, context->cf_run_loop, kCFRunLoopDefaultMode); - } - } - tsk_safeobj_unlock(context); - - bail: TSK_DEBUG_INFO("Stopped [%s] server with IP {%s} on port {%d}...", transport->description, transport->master->ip, transport->master->port); + if(context->cf_run_loop) { + // Remove all the sockets, streams and sources from the run loop + tsk_safeobj_lock(context); + for(i = 0; i < context->count; i++) { + transport_context_t *context = transport->context; + transport_socket_xt *sock = context->sockets[i]; + + if (!sock) { + continue; + } + if (sock->cf_run_loop_source) { + CFRunLoopRemoveSource(context->cf_run_loop, sock->cf_run_loop_source, kCFRunLoopDefaultMode); + } + if (sock->cf_read_stream) { + CFReadStreamUnscheduleFromRunLoop(sock->cf_read_stream, context->cf_run_loop, kCFRunLoopDefaultMode); + } + if (sock->cf_write_stream) { + CFWriteStreamUnscheduleFromRunLoop(sock->cf_write_stream, context->cf_run_loop, kCFRunLoopDefaultMode); + } + } + tsk_safeobj_unlock(context); + // Release context CFRelease(context->cf_run_loop); context->cf_run_loop = NULL; } |