Changeset 722


Ignore:
Timestamp:
01/14/12 04:08:46 (4 months ago)
Author:
shiretu
Message:

-- replaced all assert() calls with o_assert wrapper
-- small formatting here and there

Location:
trunk
Files:
47 edited

Legend:

Unmodified
Added
Removed
  • trunk/builders/cmake/CMakeLists.txt

    r690 r722  
    8181        ADD_DEFINITIONS(-DCOMPILE_STATIC) 
    8282        SET(LIB_TYPE STATIC) 
    83         ADD_SUBDIRECTORY(lua lua) 
    84         ADD_SUBDIRECTORY(tinyxml tinyxml) 
    8583        SET(LUA_LIBRARY_PATH "lua") 
    8684        SET(LUA_INCLUDE_PATH "${CRTMPSERVER_3RDPARTY_ROOT}/lua-dev") 
     
    107105        ENDIF(NOT TINYXML_FOUND) 
    108106ENDIF($ENV{COMPILE_STATIC} MATCHES "1") 
     107 
     108#disable file/line/function inside logging 
     109#ADD_DEFINITIONS(-DFILE_OVERRIDE) 
     110#ADD_DEFINITIONS(-DLINE_OVERRIDE) 
     111#ADD_DEFINITIONS(-DFUNC_OVERRIDE) 
     112#ADD_DEFINITIONS(-DASSERT_OVERRIDE) 
    109113 
    110114#fine tunning 
     
    187191 
    188192 
    189 #ADD_DEFINITIONS(-DHAS_SAFE_LOGGER) 
     193IF($ENV{COMPILE_STATIC} MATCHES "1") 
     194    ADD_SUBDIRECTORY(lua lua) 
     195    ADD_SUBDIRECTORY(tinyxml tinyxml) 
     196ENDIF($ENV{COMPILE_STATIC} MATCHES "1") 
    190197ADD_SUBDIRECTORY(common common) 
    191198ADD_SUBDIRECTORY(thelib thelib) 
    192 #ADD_SUBDIRECTORY(vm vm) 
    193199ADD_SUBDIRECTORY(applications applications) 
    194200ADD_SUBDIRECTORY(crtmpserver crtmpserver) 
    195 #ADD_SUBDIRECTORY(vmtests vmtests) 
    196201ADD_SUBDIRECTORY(tests) 
    197 #ADD_SUBDIRECTORY(androidapplestreaming androidapplestreaming) 
    198  
     202 
  • trunk/sources/applications/applestreamingclient/src/clientcontext.cpp

    r625 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    450450        //1. Get the context 
    451451        uint32_t contextId = parameters["contextId"]; 
    452         assert(contextId != 0); 
     452        o_assert(contextId != 0); 
    453453        ClientContext *pContext = GetContext(contextId, 0, 0); 
    454454        if (pContext == NULL) { 
  • trunk/sources/applications/applestreamingclient/src/protocols/key/inboundkeyprotocol.cpp

    r439 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    5454        //2. Get the transport 
    5555        OutboundHTTPProtocol *pHttpProtocol = (OutboundHTTPProtocol *) GetFarProtocol(); 
    56         assert(pHttpProtocol != NULL); 
     56        o_assert(pHttpProtocol != NULL); 
    5757 
    5858        //3. See if we have the 200 OK 
  • trunk/sources/applications/applestreamingclient/src/protocols/m3u8/basem3u8protocol.cpp

    r160 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    5252        //1. Get the transport 
    5353        OutboundHTTPProtocol *pHttpProtocol = (OutboundHTTPProtocol *) GetFarProtocol(); 
    54         assert(pHttpProtocol != NULL); 
     54        o_assert(pHttpProtocol != NULL); 
    5555 
    5656        //2. See if we have the 200 OK 
  • trunk/sources/common/include/platform/platform.h

    r404 r722  
    7171#endif /* ANDROID */ 
    7272 
     73#ifdef ASSERT_OVERRIDE 
     74#define o_assert(x) \ 
     75do { \ 
     76        if((x)==0) \ 
     77                exit(-1); \ 
     78} while(0) 
     79#else 
     80#define o_assert(x) assert(x) 
     81#endif 
     82 
    7383#endif /* _PLATFORM_H */ 
  • trunk/sources/common/include/utils/buffering/bitarray.h

    r528 r722  
    7474 
    7575                if (GETAVAILABLEBYTESCOUNT(*this) == 0) { 
    76                         assert(false); 
     76                        o_assert(false); 
    7777                } 
    7878 
    7979                if (GETAVAILABLEBYTESCOUNT(*this) < (_cursor + count) / 8) { 
    80                         assert(false); 
     80                        o_assert(false); 
    8181                } 
    8282 
    8383                if (count>sizeof (T)*8) { 
    84                         assert(false); 
     84                        o_assert(false); 
    8585                } 
    8686 
     
    100100        void IgnoreBits(uint32_t count) { 
    101101                if (GETAVAILABLEBYTESCOUNT(*this) == 0) { 
    102                         assert(false); 
     102                        o_assert(false); 
    103103                } 
    104104 
    105105                if (GETAVAILABLEBYTESCOUNT(*this) < (_cursor + count) / 8) { 
    106                         assert(false); 
     106                        o_assert(false); 
    107107                } 
    108108 
  • trunk/sources/common/include/utils/logging/logging.h

    r547 r722  
    5454#define NYI WARN("%s not yet implemented",__func__); 
    5555#define NYIR do{NYI;return false;}while(0) 
    56 #define NYIA do{NYI;assert(false);abort();}while(0) 
     56#define NYIA do{NYI;o_assert(false);abort();}while(0) 
    5757#define _PROD_ACCESS_ (_FATAL_+1) 
    5858#define _PROD_ERROR_ (_PROD_ACCESS_+1) 
  • trunk/sources/common/include/utils/mempool/mempool.h

    r422 r722  
    4141#define DECLARE_MEMORY_POOL_STRUCT(Cls) \ 
    4242    static void* operator new(size_t s) { \ 
    43         assert(s == sizeof (Cls)); \ 
     43        o_assert(s == sizeof (Cls)); \ 
    4444        return StaticMemoryPool<sizeof (Cls)>::GetInstance()->Allocate(); \ 
    4545    } \ 
  • trunk/sources/common/src/platform/android/androidplatform.cpp

    r643 r722  
    4646        char *pBuffer = NULL; 
    4747        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    48                 assert(false); 
     48                o_assert(false); 
    4949                return ""; 
    5050        } 
  • trunk/sources/common/src/platform/dfreebsd/dfreebsdplatform.cpp

    r643 r722  
    4343        char *pBuffer = NULL; 
    4444        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    45                 assert(false); 
     45                o_assert(false); 
    4646                return ""; 
    4747        } 
  • trunk/sources/common/src/platform/freebsd/freebsdplatform.cpp

    r666 r722  
    4343        char *pBuffer = NULL; 
    4444        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    45                 assert(false); 
     45                o_assert(false); 
    4646                return ""; 
    4747        } 
  • trunk/sources/common/src/platform/linux/linuxplatform.cpp

    r643 r722  
    4545        char *pBuffer = NULL; 
    4646        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    47                 assert(false); 
     47                o_assert(false); 
    4848                return ""; 
    4949        } 
  • trunk/sources/common/src/platform/openbsd/openbsdplatform.cpp

    r643 r722  
    4343        char *pBuffer = NULL; 
    4444        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    45                 assert(false); 
     45                o_assert(false); 
    4646                return ""; 
    4747        } 
  • trunk/sources/common/src/platform/osx/osxplatform.cpp

    r643 r722  
    4444        char *pBuffer = NULL; 
    4545        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    46                 assert(false); 
     46                o_assert(false); 
    4747                return ""; 
    4848        } 
  • trunk/sources/common/src/platform/solaris/solarisplatform.cpp

    r643 r722  
    8282        char *pBuffer = NULL; 
    8383        if (vasprintf(&pBuffer, STR(fmt), args) == -1) { 
    84                 assert(false); 
     84                o_assert(false); 
    8585                return ""; 
    8686        } 
  • trunk/sources/common/src/utils/buffering/iobuffer.cpp

    r712 r722  
    2424#ifdef WITH_SANITY_INPUT_BUFFER 
    2525#define SANITY_INPUT_BUFFER \ 
    26 assert(_consumed<=_published); \ 
    27 assert(_published<=_size); 
     26o_assert(_consumed<=_published); \ 
     27o_assert(_published<=_size); 
    2828#define SANITY_INPUT_BUFFER_INDEX \ 
    29 assert(index >= 0); \ 
    30 assert((_published - _consumed - index) > 0); 
     29o_assert(index >= 0); \ 
     30o_assert((_published - _consumed - index) > 0); 
    3131#else 
    3232#define SANITY_INPUT_BUFFER 
     
    338338void IOBuffer::SetMinChunkSize(uint32_t minChunkSize) { 
    339339 
    340         assert(minChunkSize > 0 && minChunkSize < 16 * 1024 * 1024); 
     340        o_assert(minChunkSize > 0 && minChunkSize < 16 * 1024 * 1024); 
    341341        _minChunkSize = minChunkSize; 
    342342} 
  • trunk/sources/common/src/utils/logging/logger.cpp

    r633 r722  
    3535                if (pMutex == NULL) { 
    3636                        printf("Logger not initialized\n"); 
    37                         assert(false); 
     37                        o_assert(false); 
    3838                } 
    3939                _pMutex = pMutex; 
    4040                if (pthread_mutex_lock(_pMutex) != 0) { 
    4141                        printf("Unable to lock the logger"); 
    42                         assert(false); 
     42                        o_assert(false); 
    4343                } 
    4444        }; 
     
    4747                if (pthread_mutex_unlock(_pMutex) != 0) { 
    4848                        printf("Unable to unlock the logger"); 
    49                         assert(false); 
     49                        o_assert(false); 
    5050                } 
    5151        } 
     
    7676        if (_pMutex != NULL) { 
    7777                printf("logger already initialized"); 
    78                 assert(false); 
     78                o_assert(false); 
    7979        } 
    8080        _pMutex = new pthread_mutex_t; 
    8181        if (pthread_mutex_init(_pMutex, NULL)) { 
    8282                printf("Unable to init the logger mutex"); 
    83                 assert(false); 
     83                o_assert(false); 
    8484        } 
    8585#else 
  • trunk/sources/common/src/utils/mempool/mempool.cpp

    r422 r722  
    7979MemoryPool::~MemoryPool() { 
    8080        Cleanup(); 
    81         assert(_used == 0); 
     81        o_assert(_used == 0); 
    8282        MemoryPoolManager::GetInstance().UnRegister(this); 
    8383} 
     
    9797void MemoryPool::Deallocate(void *p) { 
    9898        _used--; 
    99         assert(p != NULL); 
     99        o_assert(p != NULL); 
    100100        MemPoolEntry* pEntry = (MemPoolEntry *) (p); 
    101101        pEntry->pNext = _pEntries; 
  • trunk/sources/common/src/utils/misc/crypto.cpp

    r653 r722  
    248248        HMAC_CTX_cleanup(&ctx); 
    249249 
    250         assert(digestLen == 32); 
     250        o_assert(digestLen == 32); 
    251251} 
    252252 
  • trunk/sources/common/src/utils/misc/variant.cpp

    r704 r722  
    363363                { 
    364364                        FATAL("Invalid type: %hhu", _type); 
    365                         assert(false); 
     365                        o_assert(false); 
    366366                } 
    367367        } 
  • trunk/sources/thelib/include/netio/fdstats.h

    r712 r722  
    5151 
    5252        inline void Increment() { 
    53                 assert(_current >= 0); 
    54                 assert(_max >= 0); 
     53                o_assert(_current >= 0); 
     54                o_assert(_max >= 0); 
    5555                _current++; 
    5656                _max = _max < _current ? _current : _max; 
    5757                _total++; 
    58                 assert(_current >= 0); 
    59                 assert(_max >= 0); 
     58                o_assert(_current >= 0); 
     59                o_assert(_max >= 0); 
    6060        } 
    6161 
    6262        inline void Decrement() { 
    63                 assert(_current >= 0); 
    64                 assert(_max >= 0); 
     63                o_assert(_current >= 0); 
     64                o_assert(_max >= 0); 
    6565                _current--; 
    66                 assert(_current >= 0); 
    67                 assert(_max >= 0); 
     66                o_assert(_current >= 0); 
     67                o_assert(_max >= 0); 
    6868        } 
    6969#ifdef GLOBALLY_ACCOUNT_BYTES 
  • trunk/sources/thelib/include/protocols/rtmp/basertmpappprotocolhandler.h

    r718 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    253253         * */ 
    254254        virtual InNetRTMPStream *CreateInNetStream(BaseRTMPProtocol *pFrom, 
    255                 uint32_t channelId, uint32_t streamId, string streamName); 
     255                        uint32_t channelId, uint32_t streamId, string streamName); 
    256256 
    257257private: 
  • trunk/sources/thelib/include/protocols/rtmp/streaming/outnetrtmp4tsstream.h

    r721 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    4040                        string name, uint32_t rtmpStreamId, uint32_t chunkSize); 
    4141        virtual ~OutNetRTMP4TSStream(); 
    42          
     42 
    4343        virtual void SignalAttachedToInStream(); 
    4444 
  • trunk/sources/thelib/src/mediaformats/nsv/nsvdocument.cpp

    r413 r722  
    102102        //15. Add the binary headers 
    103103        for (uint32_t i = 0; i < binaryHeaders.size(); i++) { 
    104                 assert(binaryHeaders[i].absoluteTime == 0); 
     104                o_assert(binaryHeaders[i].absoluteTime == 0); 
    105105                ADD_VECTOR_BEGIN(_frames, binaryHeaders[i]); 
    106106        } 
  • trunk/sources/thelib/src/netio/epoll/inboundnamedpipecarrier.cpp

    r637 r722  
    7676        if ((event.events & EPOLLIN) != 0) { 
    7777                IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    78                 assert(pInputBuffer != NULL); 
     78                o_assert(pInputBuffer != NULL); 
    7979                if (!pInputBuffer->ReadFromPipe(_inboundFd, FD_READ_CHUNK, 
    8080                                recvBytes)) { 
  • trunk/sources/thelib/src/netio/epoll/iohandlermanager.cpp

    r712 r722  
    5858void IOHandlerManager::Start() { 
    5959        _eq = epoll_create(EPOLL_QUERY_SIZE); 
    60         assert(_eq > 0); 
     60        o_assert(_eq > 0); 
    6161} 
    6262 
  • trunk/sources/thelib/src/netio/epoll/stdiocarrier.cpp

    r712 r722  
    5454                return _pInstance; 
    5555        } 
    56         assert(_pInstance->_pProtocol != NULL); 
    57         assert(pProtocol != NULL); 
     56        o_assert(_pInstance->_pProtocol != NULL); 
     57        o_assert(pProtocol != NULL); 
    5858        if (_pInstance->_pProtocol->GetId() != pProtocol->GetId()) { 
    5959                FATAL("Stdio carrier is already acquired"); 
     
    7171        if ((event.events & EPOLLIN) != 0) { 
    7272                IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    73                 assert(pInputBuffer != NULL); 
     73                o_assert(pInputBuffer != NULL); 
    7474                if (!pInputBuffer->ReadFromStdio(_inboundFd, FD_READ_CHUNK, _ioAmount)) { 
    7575                        FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/epoll/tcpacceptor.cpp

    r710 r722  
    3838        _address.sin_family = PF_INET; 
    3939        _address.sin_addr.s_addr = inet_addr(ipAddress.c_str()); 
    40         assert(_address.sin_addr.s_addr != INADDR_NONE); 
     40        o_assert(_address.sin_addr.s_addr != INADDR_NONE); 
    4141        _address.sin_port = EHTONS(port); //----MARKED-SHORT---- 
    4242 
     
    9595 
    9696void TCPAcceptor::SetApplication(BaseClientApplication *pApplication) { 
    97         assert(_pApplication == NULL); 
     97        o_assert(_pApplication == NULL); 
    9898        _pApplication = pApplication; 
    9999} 
  • trunk/sources/thelib/src/netio/epoll/tcpcarrier.cpp

    r712 r722  
    7070        if ((event.events & EPOLLIN) != 0) { 
    7171                IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    72                 assert(pInputBuffer != NULL); 
     72                o_assert(pInputBuffer != NULL); 
    7373                if (!pInputBuffer->ReadFromTCPFd(_inboundFd, _recvBufferSize, _ioAmount)) { 
    7474                        FATAL("Unable to read data. %s:%hu -> %s:%hu", 
  • trunk/sources/thelib/src/netio/epoll/udpcarrier.cpp

    r712 r722  
    4646        if ((event.events & EPOLLIN) != 0) { 
    4747                IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    48                 assert(pInputBuffer != NULL); 
     48                o_assert(pInputBuffer != NULL); 
    4949                if (!pInputBuffer->ReadFromUDPFd(_inboundFd, _ioAmount, _peerAddress)) { 
    5050                        FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/kqueue/inboundnamedpipecarrier.cpp

    r637 r722  
    7878                { 
    7979                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    80                         assert(pInputBuffer != NULL); 
     80                        o_assert(pInputBuffer != NULL); 
    8181                        if (!pInputBuffer->ReadFromPipe(event.ident, event.data, recvAmount)) { 
    8282                                FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/kqueue/iohandlermanager.cpp

    r712 r722  
    9999void IOHandlerManager::Start() { 
    100100        _kq = kqueue(); 
    101         assert(_kq > 0); 
     101        o_assert(_kq > 0); 
    102102} 
    103103 
  • trunk/sources/thelib/src/netio/kqueue/stdiocarrier.cpp

    r712 r722  
    6060                return _pInstance; 
    6161        } 
    62         assert(_pInstance->_pProtocol != NULL); 
    63         assert(pProtocol != NULL); 
     62        o_assert(_pInstance->_pProtocol != NULL); 
     63        o_assert(pProtocol != NULL); 
    6464        if (_pInstance->_pProtocol->GetId() != pProtocol->GetId()) { 
    6565                FATAL("Stdio carrier is already acquired"); 
     
    7979                { 
    8080                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    81                         assert(pInputBuffer != NULL); 
     81                        o_assert(pInputBuffer != NULL); 
    8282                        if (!pInputBuffer->ReadFromStdio(event.ident, event.data, _ioAmount)) { 
    8383                                FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/kqueue/tcpacceptor.cpp

    r710 r722  
    3535        _address.sin_family = PF_INET; 
    3636        _address.sin_addr.s_addr = inet_addr(ipAddress.c_str()); 
    37         assert(_address.sin_addr.s_addr != INADDR_NONE); 
     37        o_assert(_address.sin_addr.s_addr != INADDR_NONE); 
    3838        _address.sin_port = EHTONS(port); //----MARKED-SHORT---- 
    3939 
     
    9292 
    9393void TCPAcceptor::SetApplication(BaseClientApplication *pApplication) { 
    94         assert(_pApplication == NULL); 
     94        o_assert(_pApplication == NULL); 
    9595        _pApplication = pApplication; 
    9696} 
  • trunk/sources/thelib/src/netio/kqueue/tcpcarrier.cpp

    r712 r722  
    7070                { 
    7171                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    72                         assert(pInputBuffer != NULL); 
     72                        o_assert(pInputBuffer != NULL); 
    7373                        if (!pInputBuffer->ReadFromTCPFd(event.ident, event.data, _ioAmount)) { 
    7474                                FATAL("Unable to read data. %s:%hu -> %s:%hu", 
  • trunk/sources/thelib/src/netio/kqueue/udpcarrier.cpp

    r712 r722  
    4646                { 
    4747                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    48                         assert(pInputBuffer != NULL); 
     48                        o_assert(pInputBuffer != NULL); 
    4949                        if (!pInputBuffer->ReadFromUDPFd(event.ident, _ioAmount, _peerAddress)) { 
    5050                                FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/select/inboundnamedpipecarrier.cpp

    r637 r722  
    7272                { 
    7373                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    74                         assert(pInputBuffer != NULL); 
     74                        o_assert(pInputBuffer != NULL); 
    7575                        if (!pInputBuffer->ReadFromPipe(_inboundFd, 
    7676                                        FD_READ_CHUNK, recvAmount)) { 
  • trunk/sources/thelib/src/netio/select/stdiocarrier.cpp

    r712 r722  
    5959                return _pInstance; 
    6060        } 
    61         assert(_pInstance->_pProtocol != NULL); 
    62         assert(pProtocol != NULL); 
     61        o_assert(_pInstance->_pProtocol != NULL); 
     62        o_assert(pProtocol != NULL); 
    6363        if (_pInstance->_pProtocol->GetId() != pProtocol->GetId()) { 
    6464                FATAL("Stdio carrier is already acquired"); 
     
    7878                { 
    7979                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    80                         assert(pInputBuffer != NULL); 
     80                        o_assert(pInputBuffer != NULL); 
    8181                        if (!pInputBuffer->ReadFromStdio(_inboundFd, FD_READ_CHUNK, _ioAmount)) { 
    8282                                FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/netio/select/tcpacceptor.cpp

    r710 r722  
    3535        _address.sin_family = PF_INET; 
    3636        _address.sin_addr.s_addr = inet_addr(ipAddress.c_str()); 
    37         assert(_address.sin_addr.s_addr != INADDR_NONE); 
     37        o_assert(_address.sin_addr.s_addr != INADDR_NONE); 
    3838        _address.sin_port = EHTONS(port); //----MARKED-SHORT---- 
    3939 
     
    9393 
    9494void TCPAcceptor::SetApplication(BaseClientApplication *pApplication) { 
    95         assert(_pApplication == NULL); 
     95        o_assert(_pApplication == NULL); 
    9696        _pApplication = pApplication; 
    9797} 
  • trunk/sources/thelib/src/netio/select/tcpcarrier.cpp

    r712 r722  
    7979                { 
    8080                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    81                         assert(pInputBuffer != NULL); 
     81                        o_assert(pInputBuffer != NULL); 
    8282                        if (!pInputBuffer->ReadFromTCPFd(_inboundFd, 
    8383                                        _recvBufferSize, _ioAmount)) { 
  • trunk/sources/thelib/src/netio/select/udpcarrier.cpp

    r712 r722  
    4646                { 
    4747                        IOBuffer *pInputBuffer = _pProtocol->GetInputBuffer(); 
    48                         assert(pInputBuffer != NULL); 
     48                        o_assert(pInputBuffer != NULL); 
    4949                        if (!pInputBuffer->ReadFromUDPFd(_inboundFd, _ioAmount, _peerAddress)) { 
    5050                                FATAL("Unable to read data"); 
  • trunk/sources/thelib/src/protocols/http/basehttpprotocol.cpp

    r496 r722  
    213213                return _lastChunk; 
    214214        } else { 
    215                 assert(_sessionDecodedBytesCount <= _contentLength); 
     215                o_assert(_sessionDecodedBytesCount <= _contentLength); 
    216216                return _sessionDecodedBytesCount == _contentLength; 
    217217        } 
     
    444444        //which is how many bytes we have available, but no more than _contentLength 
    445445        uint32_t chunkSize = GETAVAILABLEBYTESCOUNT(buffer); 
    446         assert(_sessionDecodedBytesCount <= _contentLength); 
     446        o_assert(_sessionDecodedBytesCount <= _contentLength); 
    447447        uint32_t remaining = _contentLength - _sessionDecodedBytesCount; 
    448448        chunkSize = chunkSize > remaining ? remaining : chunkSize; 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpappprotocolhandler.cpp

    r718 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    18611861 
    18621862BaseOutFileStream* BaseRTMPAppProtocolHandler::CreateOutFileStream( 
    1863         BaseRTMPProtocol *pFrom, Variant &meta, bool append) 
    1864 { 
     1863                BaseRTMPProtocol *pFrom, Variant &meta, bool append) { 
    18651864        //1. Compute the file name 
    18661865        string fileName = meta[META_SERVER_MEDIA_DIR]; 
     
    18771876                        (meta[META_MEDIA_TYPE] == MEDIA_TYPE_FLV)) { 
    18781877                return new OutFileRTMPFLVStream(pFrom, 
    1879                         GetApplication()->GetStreamsManager(), fileName); 
     1878                                GetApplication()->GetStreamsManager(), fileName); 
    18801879        } 
    18811880        if (meta[META_MEDIA_TYPE] == MEDIA_TYPE_MP4) { 
     
    18881887 
    18891888InNetRTMPStream *BaseRTMPAppProtocolHandler::CreateInNetStream( 
    1890         BaseRTMPProtocol *pFrom, uint32_t channelId, uint32_t streamId, 
    1891         string streamName) { 
     1889                BaseRTMPProtocol *pFrom, uint32_t channelId, uint32_t streamId, 
     1890                string streamName) { 
    18921891        return new InNetRTMPStream(pFrom, 
    1893                 GetApplication()->GetStreamsManager(), streamName, streamId, channelId); 
     1892                        GetApplication()->GetStreamsManager(), streamName, streamId, channelId); 
    18941893 
    18951894} 
     
    21072106        } 
    21082107 
    2109 //      //3. Compute tcUrl: rtmp://host/appName 
    2110 //      string tcUrl = format("%s://%s%s/%s", 
    2111 //                      STR(uri.scheme()), 
    2112 //                      STR(uri.host()), 
    2113 //                      STR(uri.portSpecified() ? format(":%"PRIu32) : ""), 
    2114 //                      STR(appName)); 
     2108        //      //3. Compute tcUrl: rtmp://host/appName 
     2109        //      string tcUrl = format("%s://%s%s/%s", 
     2110        //                      STR(uri.scheme()), 
     2111        //                      STR(uri.host()), 
     2112        //                      STR(uri.portSpecified() ? format(":%"PRIu32) : ""), 
     2113        //                      STR(appName)); 
    21152114 
    21162115        //4. Get the user agent 
  • trunk/sources/thelib/src/protocols/rtmp/basertmpprotocol.cpp

    r720 r722  
    1 /*  
     1/* 
    22 *  Copyright (c) 2010, 
    33 *  Gavriloaie Eugen-Andrei (shiretu@gmail.com) 
     
    428428 
    429429InNetRTMPStream * BaseRTMPProtocol::CreateINS(uint32_t channelId, 
    430         uint32_t streamId, string streamName) { 
     430                uint32_t streamId, string streamName) { 
    431431        if (streamId == 0 || streamId >= MAX_STREAMS_COUNT) { 
    432432                FATAL("Invalid stream id: %u", streamId); 
     
    448448 
    449449        InNetRTMPStream *pStream = _pProtocolHandler->CreateInNetStream(this, 
    450                 channelId, streamId, streamName); 
     450                        channelId, streamId, streamName); 
    451451        _streams[streamId] = pStream; 
    452452 
     
    473473                delete _streams[streamId]; 
    474474                _streams[streamId] = NULL; 
    475     } 
     475        } 
    476476 
    477477        BaseOutNetRTMPStream *pBaseOutNetRTMPStream = BaseOutNetRTMPStream::GetInstance( 
  • trunk/sources/thelib/src/protocols/rtmp/header_le_ba.cpp

    r606 r722  
    213213                case HT_FULL: 
    214214                { 
    215                         assert(channel.lastOutProcBytes == 0); 
    216                         assert(H_IA(*this)); 
     215                        o_assert(channel.lastOutProcBytes == 0); 
     216                        o_assert(H_IA(*this)); 
    217217                        break; 
    218218                } 
    219219                case HT_SAME_STREAM: 
    220220                { 
    221                         assert(channel.lastOutProcBytes == 0); 
    222                         assert(channel.lastOutStreamId == hf.s.si); 
    223                         assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
     221                        o_assert(channel.lastOutProcBytes == 0); 
     222                        o_assert(channel.lastOutStreamId == hf.s.si); 
     223                        o_assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
    224224                        break; 
    225225                } 
    226226                case HT_SAME_LENGTH_AND_STREAM: 
    227227                { 
    228                         assert(channel.lastOutProcBytes == 0); 
    229                         assert(channel.lastOutStreamId == hf.s.si); 
    230                         assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
    231                         assert(channel.lastOutHeader.hf.s.mt == hf.s.mt); 
    232                         assert(channel.lastOutHeader.hf.s.ml == hf.s.ml); 
    233                         assert(channel.lastOutHeader.hf.s.ts != hf.s.ts); 
     228                        o_assert(channel.lastOutProcBytes == 0); 
     229                        o_assert(channel.lastOutStreamId == hf.s.si); 
     230                        o_assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
     231                        o_assert(channel.lastOutHeader.hf.s.mt == hf.s.mt); 
     232                        o_assert(channel.lastOutHeader.hf.s.ml == hf.s.ml); 
     233                        o_assert(channel.lastOutHeader.hf.s.ts != hf.s.ts); 
    234234                        break; 
    235235                } 
    236236                case HT_CONTINUATION: 
    237237                { 
    238                         assert(channel.lastOutStreamId == hf.s.si); 
    239                         assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
    240                         assert(channel.lastOutHeader.hf.s.mt == hf.s.mt); 
    241                         assert(channel.lastOutHeader.hf.s.ml == hf.s.ml); 
    242                         assert(channel.lastOutHeader.hf.s.ts == hf.s.ts); 
     238                        o_assert(channel.lastOutStreamId == hf.s.si); 
     239                        o_assert(channel.lastOutStreamId == channel.lastOutHeader.hf.s.si); 
     240                        o_assert(channel.lastOutHeader.hf.s.mt == hf.s.mt); 
     241                        o_assert(channel.lastOutHeader.hf.s.ml == hf.s.ml); 
     242                        o_assert(channel.lastOutHeader.hf.s.ts == hf.s.ts); 
    243243                        break; 
    244244                } 
  • trunk/sources/thelib/src/protocols/rtmp/monitorrtmpprotocol.cpp

    r608 r722  
    282282                                                                return false; 
    283283                                                        } 
    284                                                         assert(_channels[channelId].id == channelId); 
     284                                                        o_assert(_channels[channelId].id == channelId); 
    285285                                                        _channels[channelId].Reset(); 
    286286                                                } 
  • trunk/sources/thelib/src/protocols/rtmp/streaming/baseoutnetrtmpstream.cpp

    r721 r722  
    790790 
    791791        if (leftBytesToSend == 0) { 
    792                 assert(channel.lastOutProcBytes == H_ML(header)); 
     792                o_assert(channel.lastOutProcBytes == H_ML(header)); 
    793793                channel.lastOutProcBytes = 0; 
    794794        } 
Note: See TracChangeset for help on using the changeset viewer.