From c18894ddb3b1dbfb94deea28114bce4967af2119 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 8 Nov 2015 17:38:00 -0500 Subject: frame: Improve doc strings and comments. --- web/socket/frame.scm | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'web') 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! 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 -- cgit v1.2.3