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

Function emscripten_async_wget2_got_data

src/eepp/network/http.cpp:1382–1398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1380};
1381
1382void emscripten_async_wget2_got_data( unsigned, void* vwget, void* buffer, unsigned bufferSize ) {
1383 WGetAsyncRequest* wget = reinterpret_cast<WGetAsyncRequest*>( vwget );
1384 Http::Response::Status status = Http::Response::Status::Ok;
1385 if ( wget->writeTo ) {
1386 wget->writeTo->write( (const char*)buffer, bufferSize );
1387 Http::Response response =
1388 Http::Response::createFakeResponse( Http::Response::FieldTable(), status, "" );
1389 wget->cb( *wget->http, wget->request, response );
1390 } else {
1391 std::string responseBody;
1392 responseBody.insert( 0, (const char*)buffer, bufferSize );
1393 Http::Response response = Http::Response::createFakeResponse( Http::Response::FieldTable(),
1394 status, responseBody );
1395 wget->cb( *wget->http, wget->request, response );
1396 }
1397 delete wget;
1398}
1399
1400void emscripten_async_wget2_got_file( unsigned int, void* vwget, const char* ) {
1401 WGetAsyncRequest* wget = reinterpret_cast<WGetAsyncRequest*>( vwget );

Callers

nothing calls this directly

Calls 2

writeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected