MCPcopy Create free account
hub / github.com/SpartanJ/eepp / receive

Method receive

src/eepp/network/ftp.cpp:571–590  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569}
570
571void Ftp::DataChannel::receive( std::ostream& stream ) {
572 connect();
573
574 // Receive data
575 char buffer[1024];
576 std::size_t received;
577
578 while ( mDataSocket->receive( buffer, sizeof( buffer ), received ) == Socket::Done ) {
579 stream.write( buffer, static_cast<std::streamsize>( received ) );
580
581 if ( !stream.good() ) {
582 Log::error( "FTP Error: Writing to the file has failed" );
583 break;
584 }
585 }
586
587 // Close the data socket
588 mDataSocket->disconnect();
589 mConnected = false;
590}
591
592void Ftp::DataChannel::send( std::istream& stream ) {
593 connect();

Callers 4

getDirectoryListingMethod · 0.45
downloadMethod · 0.45
getResponseMethod · 0.45
downloadRequestMethod · 0.45

Calls 3

errorFunction · 0.85
writeMethod · 0.45
disconnectMethod · 0.45

Tested by

no test coverage detected