MCPcopy Create free account
hub / github.com/amule-project/amule / FlushBuffers

Method FlushBuffers

src/libs/ec/cpp/ECSocket.cpp:743–764  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743bool CECSocket::FlushBuffers()
744{
745 if (m_tx_flags & EC_FLAG_ZLIB) {
746 do {
747 m_z.next_out = &m_out_ptr[0];
748 m_z.avail_out = EC_SOCKET_BUFFER_SIZE;
749 int zerror = deflate(&m_z, Z_FINISH);
750 if ( zerror == Z_STREAM_ERROR ) {
751 AddDebugLogLineN(logEC, "FlushBuffers: ZLib error");
752 ShowZError(zerror, &m_z);
753 return false;
754 }
755 WriteBufferToSocket(&m_out_ptr[0],
756 EC_SOCKET_BUFFER_SIZE - m_z.avail_out);
757 } while ( m_z.avail_out == 0 );
758 }
759 if ( m_curr_tx_data->GetDataLength() ) {
760 m_output_queue.push_back(m_curr_tx_data.release());
761 m_curr_tx_data.reset(new CQueuedData(EC_SOCKET_BUFFER_SIZE));
762 }
763 return true;
764}
765
766//
767// Packet I/O

Callers 1

SerializeTagMethod · 0.80

Calls 4

ShowZErrorFunction · 0.85
GetDataLengthMethod · 0.80
releaseMethod · 0.45
resetMethod · 0.45

Tested by

no test coverage detected