Fix: Java agent: update ref count in enabledLoggers
[lttng-ust.git] / liblttng-ust-java-agent / java / org / lttng / ust / agent / LTTngTCPSessiondClient.java
index db4e1f70c75d31b861d26b9d39c91628ccbf01a5..76e8426b2344cad4f67b8b9e39386f2d493ad343 100644 (file)
@@ -185,6 +185,22 @@ class LTTngTCPSessiondClient implements Runnable {
                        switch (headerCmd.cmd) {
                                case CMD_REG_DONE:
                                {
+                                       /*
+                                        * Check command version:
+                                        *
+                                        *   * 0:  Connected to a non-fixed session daemon,
+                                        *         which could send multiple disable
+                                        *         event commands: do not decrement
+                                        *         reference count on disable event command
+                                        *         (original behaviour).
+                                        *   * >0: Connected to a fixed session daemon:
+                                        *         do decrement reference count on disable
+                                        *         event command.
+                                        */
+                                       if (headerCmd.cmd_version > 0) {
+                                               this.log.setEnableRefCountDecrement(true);
+                                       }
+
                                        /*
                                         * Release semaphore so meaning registration is done and we
                                         * can proceed to continue tracing.
This page took 0.024182 seconds and 4 git commands to generate.