diff --git a/src/Http/HttpSession.cpp b/src/Http/HttpSession.cpp index 21b0d226..984ec9dd 100644 --- a/src/Http/HttpSession.cpp +++ b/src/Http/HttpSession.cpp @@ -396,8 +396,6 @@ inline HttpSession::HttpCode HttpSession::Handle_Req_GET() { }); GET_CONFIG_AND_REGISTER(uint32_t,sendBufSize,Config::Http::kSendBufSize); - //不允许主动丢包 - _sock->setShouldDropPacket(false); //缓存大小为两个包,太大可能导致发送时间太长从而超时 _sock->setSendPktSize(2); weak_ptr weakSelf = dynamic_pointer_cast(shared_from_this()); diff --git a/src/Rtmp/RtmpProtocol.cpp b/src/Rtmp/RtmpProtocol.cpp index 4605628b..edc07ae2 100644 --- a/src/Rtmp/RtmpProtocol.cpp +++ b/src/Rtmp/RtmpProtocol.cpp @@ -207,7 +207,7 @@ void RtmpProtocol::sendRtmp(uint8_t ui8Type, uint32_t ui32StreamId, //估算rtmp包数据大小 uint32_t capacity = ((bExtStamp ? 5 : 1) * (1 + (strBuf.size() / m_iChunkLenOut))) + strBuf.size() + sizeof(header); uint32_t totalSize = 0; - BufferRaw::Ptr buffer = m_bufferPool.obtain(); + BufferRaw::Ptr buffer = obtainBuffer(); buffer->setCapacity(capacity); memcpy(buffer->data() + totalSize,(char *) &header, sizeof(header)); totalSize += sizeof(header); @@ -687,5 +687,9 @@ void RtmpProtocol::handle_rtmpChunk(RtmpPacket& chunkData) { } } +BufferRaw::Ptr RtmpProtocol::obtainBuffer() { + return std::make_shared() ;//_bufferPool.obtain(); +} + } /* namespace Rtmp */ } /* namespace ZL */ diff --git a/src/Rtmp/RtmpProtocol.h b/src/Rtmp/RtmpProtocol.h index 3f09a123..88fb05ae 100644 --- a/src/Rtmp/RtmpProtocol.h +++ b/src/Rtmp/RtmpProtocol.h @@ -85,7 +85,8 @@ protected: int m_iNowStreamID = 0; int m_iNowChunkID = 0; bool m_bDataStarted = false; - ResourcePool m_bufferPool; + BufferRaw::Ptr obtainBuffer(); + //ResourcePool m_bufferPool; private: void handle_S0S1S2(const function &cb); void handle_C0C1();