[asterisk-commits] res http websocket: Properly encode 64 bit payload (asterisk[13])
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jul 30 16:55:37 CDT 2015
Joshua Colp has submitted this change and it was merged.
Change subject: res_http_websocket: Properly encode 64 bit payload
......................................................................
res_http_websocket: Properly encode 64 bit payload
A test agent was continuously failing all ARI tests when run against
Asterisk 13. As it turns out, the reason for this is that on those test
runs, for some reason we decided to use the super extended 64 bit
payload length for websocket text frames instead of the extended 16 bit
payload length. For 64-bit payloads, the expected byte order over the
network is
7, 6, 5, 4, 3, 2, 1, 0
However, we were sending the payload as
3, 2, 1, 0, 7, 6, 5, 4
This meant that we were saying to expect an absolutely MASSIVE payload
to arrive. Since we did not follow through on this expected payload
size, the client would sit patiently waiting for the rest of the payload
to arrive until the test would time out.
With this change, we use the htobe64() function instead of htonl() so
that a 64-bit byte-swap is performed instead of a 32 bit byte-swap.
Change-Id: Ibcd8552392845fbcdd017a8c8c1043b7fe35964a
---
M res/res_http_websocket.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Kevin Harwell: Looks good to me, but someone else must approve
Anonymous Coward #1000019: Verified
Joshua Colp: Looks good to me, approved
diff --git a/res/res_http_websocket.c b/res/res_http_websocket.c
index 1f1f77c..144c08d 100644
--- a/res/res_http_websocket.c
+++ b/res/res_http_websocket.c
@@ -328,7 +328,7 @@
if (length == 126) {
put_unaligned_uint16(&frame[2], htons(actual_length));
} else if (length == 127) {
- put_unaligned_uint64(&frame[2], htonl(actual_length));
+ put_unaligned_uint64(&frame[2], htobe64(actual_length));
}
ao2_lock(session);
--
To view, visit https://gerrit.asterisk.org/990
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ibcd8552392845fbcdd017a8c8c1043b7fe35964a
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
More information about the asterisk-commits
mailing list