summaryrefslogtreecommitdiff
path: root/chat
diff options
context:
space:
mode:
authordbj <dbj@pkgsrc.org>2021-02-06 15:20:15 +0000
committerdbj <dbj@pkgsrc.org>2021-02-06 15:20:15 +0000
commit16e422d1f4fe113aaf70bf2de76ad5caf1933c98 (patch)
tree0b940fc35d99f3943b65e6d66b2d1e67cb0daf65 /chat
parent2955dc24349f002bb7507ebc5523f91bf5350cb2 (diff)
downloadpkgsrc-16e422d1f4fe113aaf70bf2de76ad5caf1933c98.tar.gz
chat/jabberd2: use htons instead of non-portable htobe16
Diffstat (limited to 'chat')
-rw-r--r--chat/jabberd2/distinfo3
-rw-r--r--chat/jabberd2/patches/patch-sx_websocket.c24
2 files changed, 26 insertions, 1 deletions
diff --git a/chat/jabberd2/distinfo b/chat/jabberd2/distinfo
index 4526bce1ef6..3ac08f8f895 100644
--- a/chat/jabberd2/distinfo
+++ b/chat/jabberd2/distinfo
@@ -1,7 +1,8 @@
-$NetBSD: distinfo,v 1.43 2018/11/02 12:15:25 gdt Exp $
+$NetBSD: distinfo,v 1.44 2021/02/06 15:20:15 dbj Exp $
SHA1 (jabberd-2.7.0.tar.xz) = efd638bde131cbe5e35c376c875bd92a2ed5948c
RMD160 (jabberd-2.7.0.tar.xz) = 61b7858514f4cdeadbe5f946d6ae8f42cbe6926a
SHA512 (jabberd-2.7.0.tar.xz) = 2a5d134572330a38366a17cf8b3fc6fadf56eddf604003d75cd976bd385b5d8392b01dc149e3a2962be3c340eb23429e83db25b608b9ab84f328603d3ba447da
Size (jabberd-2.7.0.tar.xz) = 1560872 bytes
SHA1 (patch-Makefile.in) = 31d8dc4a5446e96079e1016afb45dc7a602b98c9
+SHA1 (patch-sx_websocket.c) = 112f5fb6efc3254548b77cd46b310ce984288748
diff --git a/chat/jabberd2/patches/patch-sx_websocket.c b/chat/jabberd2/patches/patch-sx_websocket.c
new file mode 100644
index 00000000000..b4f5d95b8e4
--- /dev/null
+++ b/chat/jabberd2/patches/patch-sx_websocket.c
@@ -0,0 +1,24 @@
+$NetBSD: patch-sx_websocket.c,v 1.1 2021/02/06 15:20:15 dbj Exp $
+
+use htons instead of non-portable htobe16
+
+--- sx/websocket.c.orig 2018-04-22 09:41:35.000000000 +0000
++++ sx/websocket.c
+@@ -214,7 +214,7 @@ int libwebsock_close_with_reason(sx_t s,
+ unsigned short code_be;
+ char buf[128]; //w3 spec on WebSockets API (http://dev.w3.org/html5/websockets/) says reason shouldn't be over 123 bytes. I concur.
+ len = 2;
+- code_be = htobe16(code);
++ code_be = htons(code);
+ memcpy(buf, &code_be, 2);
+ if (reason) {
+ len += snprintf(buf + 2, 124, "%s", reason);
+@@ -235,7 +235,7 @@ int libwebsock_close(sx_t s, _sx_websock
+ void libwebsock_fail_connection(sx_t s, _sx_websocket_conn_t sc, unsigned short close_code) {
+ char close_frame[4] = { 0x88, 0x02, 0x00, 0x00 };
+ unsigned short *code_be = (unsigned short *) &close_frame[2];
+- *code_be = htobe16(WS_CLOSE_PROTOCOL_ERROR);
++ *code_be = htons(WS_CLOSE_PROTOCOL_ERROR);
+
+ sx_buf_t buf = _sx_buffer_new(NULL, sizeof(close_frame), NULL, NULL);
+ memcpy(buf->data, close_frame, buf->len);