summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hintz <t@thintz.com>2015-04-18 11:21:18 -0700
committerThomas Hintz <t@thintz.com>2015-04-18 11:21:18 -0700
commit90b97f7d34c6f7b40fde9503761120f19edfabb2 (patch)
tree19c7556206f237a17cc91ddad82d4cc87cc0ff48
parentfde9c289cc527f57c6eb7af99aa0738ff91d54e4 (diff)
downloadwebsockets-90b97f7d34c6f7b40fde9503761120f19edfabb2.tar.gz
Fixing unmask to pass values into foreign-lambda* instead of using
global variables.
-rw-r--r--websockets.scm10
1 files changed, 2 insertions, 8 deletions
diff --git a/websockets.scm b/websockets.scm
index 7b2087d..2576dd3 100644
--- a/websockets.scm
+++ b/websockets.scm
@@ -183,14 +183,8 @@
(u8vector-set! tmaskkey 1 (vector-ref frame-masking-key 1))
(u8vector-set! tmaskkey 2 (vector-ref frame-masking-key 2))
(u8vector-set! tmaskkey 3 (vector-ref frame-masking-key 3))
- (define-external wsmaskkey blob (u8vector->blob/shared tmaskkey))
- (define-external wslen int len)
-
- ; TODO handle -1
-
- (define-external wsv scheme-pointer payload)
- ((foreign-lambda* void ()
+ ((foreign-lambda* void ((blob wsmaskkey) (int wslen) (scheme-pointer wsv))
"
const unsigned char* maskkey2 = wsmaskkey;
const unsigned int kd = *(unsigned int*)maskkey2;
@@ -210,7 +204,7 @@
*((unsigned int*)wsv++) ^= kb[i];
}
"
-))
+) (u8vector->blob/shared tmaskkey) len payload)
payload)
(define (unmask fragment)