@@ -251,6 +251,10 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
251
251
return ;
252
252
}
253
253
254
+ if (!NRPRG (txn )-> options .distributed_tracing_enabled ) {
255
+ return ;
256
+ }
257
+
254
258
amqp_properties_array
255
259
= nr_php_get_zval_object_property (amqp_msg , "properties" );
256
260
if (!nr_php_is_zval_valid_array (amqp_properties_array )) {
@@ -286,9 +290,9 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
286
290
* The application_headers are stored in an encoded PhpAmqpLib\Wire\AMQPTable
287
291
* object
288
292
*/
293
+
289
294
amqp_headers_table = nr_php_zend_hash_find (Z_ARRVAL_P (amqp_properties_array ),
290
295
"application_headers" );
291
-
292
296
/*
293
297
* If the application_headers AMQPTable object doesn't exist, we'll have to
294
298
* create it with an empty array.
@@ -311,7 +315,6 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
311
315
"create one. Exit." );
312
316
goto end ;
313
317
}
314
-
315
318
/*
316
319
* Set the valid AMQPTable on the AMQPMessage.
317
320
*/
@@ -384,6 +387,7 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
384
387
NRSAFESTR (Z_STRVAL (key_zval_zpd )));
385
388
}
386
389
nr_php_zval_free (& retval_set_table_zvf );
390
+ zval_ptr_dtor (& key_zval_zpd );
387
391
}
388
392
}
389
393
}
@@ -394,7 +398,6 @@ static inline void nr_php_amqplib_insert_dt_headers(zval* amqp_msg) {
394
398
nr_php_zval_free (& retval_set_property_zvf );
395
399
zval_ptr_dtor (& application_headers_zpd );
396
400
zval_ptr_dtor (& amqp_table_retval_zpd );
397
- zval_ptr_dtor (& key_zval_zpd );
398
401
}
399
402
400
403
/*
@@ -437,6 +440,10 @@ static inline void nr_php_amqplib_retrieve_dt_headers(zval* amqp_msg) {
437
440
return ;
438
441
}
439
442
443
+ if (!NRPRG (txn )-> options .distributed_tracing_enabled ) {
444
+ return ;
445
+ }
446
+
440
447
amqp_properties_array
441
448
= nr_php_get_zval_object_property (amqp_msg , "properties" );
442
449
if (!nr_php_is_zval_valid_array (amqp_properties_array )) {
@@ -769,7 +776,7 @@ void nr_php_amqplib_enable() {
769
776
PHP_PACKAGE_VERSION_UNKNOWN );
770
777
}
771
778
772
- /* Extract the version for aws-sdk 3+ */
779
+ /* Extract the version */
773
780
nr_php_amqplib_handle_version ();
774
781
nr_php_amqplib_ensure_class ();
775
782
0 commit comments