From: Chris Hanson Date: Mon, 25 Aug 2008 08:23:32 +0000 (+0000) Subject: Change definition of HTTP version to that from RFC 2616. X-Git-Tag: 20090517-FFI~224 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=3191cd4a9a350bc3ce0ea945e899c5e65d72e959;p=mit-scheme.git Change definition of HTTP version to that from RFC 2616. --- diff --git a/v7/src/runtime/httpio.scm b/v7/src/runtime/httpio.scm index c975020ea..a744ca3cd 100644 --- a/v7/src/runtime/httpio.scm +++ b/v7/src/runtime/httpio.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: httpio.scm,v 14.1 2008/08/24 07:20:08 cph Exp $ +$Id: httpio.scm,v 14.2 2008/08/25 08:23:32 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -166,13 +166,13 @@ USA. (define (http-version? object) (and (pair? object) - (exact-positive-integer? (car object)) + (exact-nonnegative-integer? (car object)) (exact-nonnegative-integer? (cdr object)))) (define-guarantee http-version "HTTP version") (define (make-http-version major minor) - (guarantee-exact-positive-integer major 'MAKE-HTTP-VERSION) + (guarantee-exact-nonnegative-integer major 'MAKE-HTTP-VERSION) (guarantee-exact-nonnegative-integer minor 'MAKE-HTTP-VERSION) (cons major minor)) @@ -349,11 +349,10 @@ USA. (vector-ref v 1))) (seq "HTTP/" (map string->number - (match (seq (char-set char-set:non-zero-digit) - (* (char-set char-set:digit))))) + (match (+ (char-set char-set:digit)))) "." (map string->number - (match (* (char-set char-set:digit)))))))) + (match (+ (char-set char-set:digit)))))))) (define parse-status-code (*parser @@ -426,7 +425,6 @@ USA. (define char-set:text) (define char-set:token) (define char-set:digit) -(define char-set:non-zero-digit) (define char-set:status-major) (define http-version:1.0) (define http-version:1.1) @@ -439,8 +437,6 @@ USA. (string->char-set "()<>@,;:\\\"/[]?={} \t"))) (set! char-set:digit (string->char-set "0123456789")) - (set! char-set:non-zero-digit - (string->char-set "123456789")) (set! char-set:status-major (string->char-set "12345")) (set! http-version:1.0 (make-http-version 1 0))