From ccab575636032088128e0af01a464a7811756aad Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 25 Aug 2008 20:53:33 +0000 Subject: [PATCH] Export character sets for HTTP text and token. --- v7/src/runtime/httpio.scm | 20 ++++++++++---------- v7/src/runtime/runtime.pkg | 4 +++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/v7/src/runtime/httpio.scm b/v7/src/runtime/httpio.scm index 1132679ca..4e24dbd80 100644 --- a/v7/src/runtime/httpio.scm +++ b/v7/src/runtime/httpio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: httpio.scm,v 14.3 2008/08/25 08:48:16 cph Exp $ +$Id: httpio.scm,v 14.4 2008/08/25 20:53:31 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -147,7 +147,7 @@ USA. (define (http-token? object) (and (interned-symbol? object) (not (eq? object '||)) - (string-in-char-set? (symbol-name object) char-set:token))) + (string-in-char-set? (symbol-name object) char-set:http-token))) (define-guarantee http-token "HTTP token") @@ -214,7 +214,7 @@ USA. (define (http-text? object) (and (string? object) - (string-in-char-set? object char-set:text))) + (string-in-char-set? object char-set:http-text))) (define-guarantee http-text "HTTP text") @@ -328,7 +328,7 @@ USA. (define parse-request-line (*parser (seq (map string->symbol - (match (+ (char-set char-set:token)))) + (match (+ (char-set char-set:http-token)))) (noise match-wsp) parse-uri-no-authority (noise match-wsp) @@ -340,7 +340,7 @@ USA. (noise match-wsp) parse-status-code (noise match-wsp) - (match (* (char-set char-set:text)))))) + (match (* (char-set char-set:http-text)))))) (define parse-version (*parser @@ -422,18 +422,18 @@ USA. (loop (fix:+ i 1))) #t)))) -(define char-set:text) -(define char-set:token) +(define char-set:http-text) +(define char-set:http-token) (define char-set:digit) (define char-set:status-major) (define http-version:1.0) (define http-version:1.1) (define (initialize-package!) - (set! char-set:text + (set! char-set:http-text (char-set-difference char-set:ascii char-set:ctls)) - (set! char-set:token - (char-set-difference char-set:text + (set! char-set:http-token + (char-set-difference char-set:http-text (string->char-set "()<>@,;:\\\"/[]?={} \t"))) (set! char-set:digit (string->char-set "0123456789")) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index f617666fe..27cb1ddd8 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.662 2008/08/25 08:48:19 cph Exp $ +$Id: runtime.pkg,v 14.663 2008/08/25 20:53:33 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -5159,6 +5159,8 @@ USA. (parent (runtime)) (export () all-http-headers + char-set:http-text + char-set:http-token error:not-http-message error:not-http-header error:not-http-request -- 2.25.1