From 22fd047d2d10dd15dd8a13b0baca6d7b2946c78a Mon Sep 17 00:00:00 2001 From: "Taylor R. Campbell" Date: Sat, 4 Nov 2006 20:16:47 +0000 Subject: [PATCH] Rename two internal operations in RFC 822 headers in the HTTP client, and export them, so that users of the library can get at them. This is a lame workaround for the problem that the RFC 822 support lies in Edwin, rather than the run-time system. At some point that should be fixed properly, and the support updated to RFC 2822, but this works for now. --- v7/src/runtime/http-client.scm | 9 ++++++--- v7/src/runtime/runtime.pkg | 4 +++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/v7/src/runtime/http-client.scm b/v7/src/runtime/http-client.scm index 267cfa299..0405135f9 100644 --- a/v7/src/runtime/http-client.scm +++ b/v7/src/runtime/http-client.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: http-client.scm,v 14.2 2006/08/02 18:18:10 cph Exp $ +$Id: http-client.scm,v 14.3 2006/11/04 20:16:47 riastradh Exp $ Copyright 2006 Taylor R. Campbell @@ -151,7 +151,7 @@ USA. (define (send-http-request connection method request-uri header-fields content) (write-http-request method request-uri - (rfc822:adjoin-header-fields + (adjoin-http-header-fields `((HOST ,(http-connection/host-string connection))) header-fields (if (string? content) @@ -341,6 +341,9 @@ USA. ;;; RFC 822 support, and something ought to be done about RFC 2822. ;;; Some day. +(define (valid-http-header-field? obj) + (rfc822:header-field? obj)) + (define (rfc822:header-field? obj) (and (pair? obj) (symbol? (car obj)) @@ -370,7 +373,7 @@ USA. (eq? (rfc822:header-field-name header-field) name)))) -(define (rfc822:adjoin-header-fields left header-fields right) +(define (adjoin-http-header-fields left header-fields right) (let ((clean (lambda (other-header-fields) (delete-matching-items other-header-fields (lambda (header-field) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index 028205eae..45a182e1f 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.603 2006/11/04 06:38:32 cph Exp $ +$Id: runtime.pkg,v 14.604 2006/11/04 20:16:47 riastradh Exp $ Copyright 1988,1989,1990,1991,1992,1993 Massachusetts Institute of Technology Copyright 1994,1995,1996,1997,1998,1999 Massachusetts Institute of Technology @@ -5053,6 +5053,7 @@ USA. (files "http-client") (parent (runtime)) (export () + adjoin-http-header-fields call-with-http-connection call-with-http-response:entity-request call-with-http-response:get @@ -5089,6 +5090,7 @@ USA. read-http-response receive-http-response send-http-request + valid-http-header-field? write-http-request )) -- 2.25.1