Skip to content

Commit

Permalink
ninjastorm server and offline fix final
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiZhang-kwf8 committed Aug 14, 2024
1 parent 7e8731d commit f63d31f
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/ninja/ninja_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,16 +256,23 @@ int NinjaInitialize(const char* typeofrun) {

// Fetch the URL with custom headers
try {
poResult = CPLHTTPFetch(charStr, papszOptions);
poResult = CPLHTTPFetch(charStr, papszOptions);
if( !poResult || poResult->nStatus != 0 || poResult->nDataLen == 0 )
{
CPLDebug( "NINJA", "Failed to reach the ninjastorm server." );
return NULL;
}
else {
if (poResult) {
CPLHTTPDestroyResult(poResult);

}
}
}
catch (std::exception& e) {
std::cout << "can't fetch" << std::endl;
}

if (poResult) {
CPLHTTPDestroyResult(poResult);

}
#endif
}

Expand Down

0 comments on commit f63d31f

Please sign in to comment.