Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions agent/native/ext/lifecycle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,14 +280,21 @@ void elasticApmModuleInit( int moduleType, int moduleNumber )
registerAtExitLogging();
registerExceptionHooks();

curlCode = curl_global_init( CURL_GLOBAL_ALL );
if ( curlCode != CURLE_OK )
if ( config->disableSend )
{
resultCode = resultFailure;
ELASTIC_APM_LOG_ERROR( "curl_global_init failed: %s (%d)", curl_easy_strerror( curlCode ), (int)curlCode );
goto finally;
ELASTIC_APM_LOG_DEBUG( "disable_send (disableSend) configuration option is set to true - skipping curl_global_init" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is tracer->curlInited == false by default?

}
else
{
curlCode = curl_global_init( CURL_GLOBAL_ALL );
if ( curlCode != CURLE_OK )
{
resultCode = resultFailure;
ELASTIC_APM_LOG_ERROR( "curl_global_init failed: %s (%d)", curl_easy_strerror( curlCode ), (int)curlCode );
goto finally;
}
tracer->curlInited = true;
}
tracer->curlInited = true;

astInstrumentationOnModuleInit( config );

Expand Down