summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hintz <t@thintz.com>2015-04-18 11:41:00 -0700
committerThomas Hintz <t@thintz.com>2015-04-18 11:41:00 -0700
commitfa6ec7695af49a3eb88fb0f6b8efd0d14ac519c4 (patch)
tree5a55b400c596709d3189b83ce10e52e2bb65b2d6
parent081209bd2f2b1aa60427de8fc1433891d30b7583 (diff)
downloadwebsockets-fa6ec7695af49a3eb88fb0f6b8efd0d14ac519c4.tar.gz
Passing in values to foreign-lambda* for UTF-8 validation instead of
using global variables.
-rw-r--r--websockets.scm6
1 files changed, 2 insertions, 4 deletions
diff --git a/websockets.scm b/websockets.scm
index 7a928bb..8cd6702 100644
--- a/websockets.scm
+++ b/websockets.scm
@@ -291,10 +291,8 @@
; Try to validate as an ascii string first. Its essentially
; free, doesn't generate garbage and is many, many times
; faster than the general purpose validator.
- (define-external ws_utlen int len)
- (define-external ws_uts scheme-pointer s)
(= 1
- ((foreign-lambda* int ()
+ ((foreign-lambda* int ((size_t ws_utlen) (scheme-pointer ws_uts))
"
if (ws_utlen > UINT_MAX) { return -1; }
@@ -308,7 +306,7 @@
}
C_return(1);
-"))))
+") len s)))
(parse utf8-string (->parser-input s))))
(define (close-code->integer s)