diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/socket/frame.scm | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/web/socket/frame.scm b/web/socket/frame.scm index 032db77..7186c00 100644 --- a/web/socket/frame.scm +++ b/web/socket/frame.scm @@ -62,15 +62,26 @@ (set-record-type-printer! <frame> display-frame) (define* (make-pong-frame bv #:optional (masking-key #f)) + "Return a \"pong\" control frame containing the contents of the +bytevector BV, masked with MASKING-KEY. By default, the data is +unmasked." (make-frame #t 'pong masking-key bv)) (define* (make-close-frame bv #:optional (masking-key #f)) + "Return a \"close\" control frame containing the contents of the +bytevector BV, masked with MASKING-KEY. By default, the data is +unmasked." (make-frame #t 'close masking-key bv)) -(define* (make-text-frame str #:optional (masking-key #f)) - (make-frame #t 'text masking-key (string->utf8 str))) +(define* (make-text-frame text #:optional (masking-key #f)) + "Return a text data frame containing the string TEXT, masked with MASKING-KEY. +By default, the text is unmasked." + (make-frame #t 'text masking-key (string->utf8 text))) (define* (make-binary-frame bv #:optional (masking-key #f)) + "Return a binary data frame containing the contents of the +bytevector BV, masked with MASKING-KEY. By default, the data is +unmasked." (make-frame #t 'binary masking-key bv)) (define (continuation-frame? frame) @@ -229,7 +240,7 @@ MASKING-KEY." (not (zero? (logand #x80 octet)))) (define (parse-opcode octet final?) - ;; The opcode is stored in the least-significant nibble of the + ;; The opcode is stored in the least significant nibble of the ;; octet. (let ((type (opcode->frame-type (logand #x0f octet)))) ;; Section 5.5 specifies that control frames must not be |