Fix: Java agent protocol network endianness consistency
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 23 Oct 2015 21:12:51 +0000 (17:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 23 Oct 2015 21:56:39 +0000 (17:56 -0400)
Considering the Agent Protocol is bumped to v2.0 as of 2.8.x,
this patch revisits the unfortunate decision of communicating
in host-endianness from the session daemon to the agents, and
in big endian from the agents to the session daemon.

This change does not affect the Python agent which was erroneously
(although quite reasonably) assuming communications were occurring
in network endianness.

This issue does not affect versions 2.7 and below because the loglevel
was not used.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/SessiondDisableEventCommand.java
liblttng-ust-java-agent/java/lttng-ust-agent-common/org/lttng/ust/agent/client/SessiondEnableEventCommand.java

index 03cd9de6fb48cf94bf7ef35a3f2da373319940c7..2956c7e20363f2cd0cbbe73bfc873453f3ff74b1 100644 (file)
@@ -38,7 +38,7 @@ class SessiondDisableEventCommand implements ISessiondCommand {
                        throw new IllegalArgumentException();
                }
                ByteBuffer buf = ByteBuffer.wrap(data);
-               buf.order(ByteOrder.LITTLE_ENDIAN);
+               buf.order(ByteOrder.BIG_ENDIAN);
                eventName = new String(data).trim();
        }
 
index c9183d19d9736d2f2cf3f0fab85239c3b6d3d2dd..5665a6916baa640954e4f272af0b1f8596253792 100644 (file)
@@ -48,7 +48,7 @@ class SessiondEnableEventCommand implements ISessiondCommand {
                        throw new IllegalArgumentException();
                }
                ByteBuffer buf = ByteBuffer.wrap(data);
-               buf.order(ByteOrder.LITTLE_ENDIAN);
+               buf.order(ByteOrder.BIG_ENDIAN);
                int logLevel = buf.getInt();
                int logLevelType = buf.getInt();
                logLevelFilter = new LogLevelSelector(logLevel, logLevelType);
This page took 0.025406 seconds and 5 git commands to generate.