From: Chris Hanson <org/chris-hanson/cph>
Date: Mon, 25 Aug 2008 08:48:33 +0000 (+0000)
Subject: Rename HTTP-ENTITY to HTTP-MESSAGE.
X-Git-Tag: 20090517-FFI~221
X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=9a8d5f8f3a89f2d4c2c7d6105f367ea169b4bf3a;p=mit-scheme.git

Rename HTTP-ENTITY to HTTP-MESSAGE.
---

diff --git a/v7/src/runtime/httpio.scm b/v7/src/runtime/httpio.scm
index a744ca3cd..1132679ca 100644
--- a/v7/src/runtime/httpio.scm
+++ b/v7/src/runtime/httpio.scm
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: httpio.scm,v 14.2 2008/08/25 08:23:32 cph Exp $
+$Id: httpio.scm,v 14.3 2008/08/25 08:48:16 cph Exp $
 
 Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
     1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
@@ -128,21 +128,21 @@ USA.
   (guarantee-string body 'MAKE-SIMPLE-HTTP-RESPONSE)
   (%make-http-response #f 200 (http-status-description 200) '() body))
 
-(define (http-entity? object)
+(define (http-message? object)
   (or (http-request? object)
       (http-response? object)))
 
-(define-guarantee http-entity "HTTP entity")
+(define-guarantee http-message "HTTP message")
 
-(define (http-entity-headers entity)
-  (cond ((http-request? entity) (http-request-headers entity))
-	((http-response? entity) (http-response-headers entity))
-	(else (error:not-http-entity entity 'HTTP-ENTITY-HEADERS))))
+(define (http-message-headers message)
+  (cond ((http-request? message) (http-request-headers message))
+	((http-response? message) (http-response-headers message))
+	(else (error:not-http-message message 'HTTP-MESSAGE-HEADERS))))
 
-(define (http-entity-body entity)
-  (cond ((http-request? entity) (http-request-body entity))
-	((http-response? entity) (http-response-body entity))
-	(else (error:not-http-entity entity 'HTTP-ENTITY-BODY))))
+(define (http-message-body message)
+  (cond ((http-request? message) (http-request-body message))
+	((http-response? message) (http-response-body message))
+	(else (error:not-http-message message 'HTTP-MESSAGE-BODY))))
 
 (define (http-token? object)
   (and (interned-symbol? object)
@@ -388,7 +388,7 @@ USA.
 		  (if (> n 0)
 		      (let ((m (read-string! buffer port)))
 			(if (= m 0)
-			    (error "Premature EOF in HTTP entity body."))
+			    (error "Premature EOF in HTTP message body."))
 			(write-substring buffer 0 m output)
 			(loop (- n m))))))))))))
 
@@ -410,7 +410,7 @@ USA.
        (%read-all port)))
 
 (define (%no-read-body)
-  (error "Unable to determine HTTP entity body length."))
+  (error "Unable to determine HTTP message body length."))
 
 ;;;; Syntax
 
@@ -504,9 +504,9 @@ USA.
       (= status 204)
       (= status 304)))
 
-(define (http-entity-body-port entity)
-  (let ((port (open-input-octets (http-entity-body entity))))
-    (receive (type coding) (http-content-type entity)
+(define (http-message-body-port message)
+  (let ((port (open-input-octets (http-message-body message))))
+    (receive (type coding) (http-content-type message)
       (cond ((eq? (mime-type/top-level type) 'TEXT)
 	     (port/set-coding port (or coding 'TEXT))
 	     (port/set-line-ending port 'TEXT))
@@ -524,8 +524,8 @@ USA.
 	     (port/set-line-ending port 'BINARY))))
     port))
 
-(define (http-content-type entity)
-  (let ((h (first-http-header 'CONTENT-TYPE entity)))
+(define (http-content-type message)
+  (let ((h (first-http-header 'CONTENT-TYPE message)))
     (if h
 	(let ((s (rfc2822-header-value h)))
 	  (let ((v (*parse-string parser:http-content-type s)))
@@ -557,11 +557,11 @@ USA.
 	  (encapsulate vector->list
 		       (* parse-parameter))))))
 
-(define (http-content-length entity)
-  (%get-content-length (http-entity-headers entity)))
+(define (http-content-length message)
+  (%get-content-length (http-message-headers message)))
 
-(define (first-http-header name entity)
-  (first-rfc2822-header name (http-entity-headers entity)))
+(define (first-http-header name message)
+  (first-rfc2822-header name (http-message-headers message)))
 
-(define (all-http-headers name entity)
-  (all-rfc2822-headers name (http-entity-headers entity)))
\ No newline at end of file
+(define (all-http-headers name message)
+  (all-rfc2822-headers name (http-message-headers message)))
\ No newline at end of file
diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg
index 62e9b3176..f617666fe 100644
--- a/v7/src/runtime/runtime.pkg
+++ b/v7/src/runtime/runtime.pkg
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: runtime.pkg,v 14.661 2008/08/25 08:37:35 cph Exp $
+$Id: runtime.pkg,v 14.662 2008/08/25 08:48:19 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,7 +5159,7 @@ USA.
   (parent (runtime))
   (export ()
 	  all-http-headers
-	  error:not-http-entity
+	  error:not-http-message
 	  error:not-http-header
 	  error:not-http-request
 	  error:not-http-response
@@ -5172,7 +5172,7 @@ USA.
 	  error:not-simple-http-response
 	  error:not-simple-http-uri
 	  first-http-header
-	  guarantee-http-entity
+	  guarantee-http-message
 	  guarantee-http-header
 	  guarantee-http-request
 	  guarantee-http-response
@@ -5186,10 +5186,10 @@ USA.
 	  guarantee-simple-http-uri
 	  http-content-length
 	  http-content-type
-	  http-entity-body
-	  http-entity-body-port
-	  http-entity-headers
-	  http-entity?
+	  http-message-body
+	  http-message-body-port
+	  http-message-headers
+	  http-message?
 	  http-header?
 	  http-request-body
 	  http-request-headers
diff --git a/v7/src/xml/xml-rpc.scm b/v7/src/xml/xml-rpc.scm
index 346179840..8fb770771 100644
--- a/v7/src/xml/xml-rpc.scm
+++ b/v7/src/xml/xml-rpc.scm
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: xml-rpc.scm,v 1.12 2008/08/24 07:21:03 cph Exp $
+$Id: xml-rpc.scm,v 1.13 2008/08/25 08:48: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,
@@ -37,7 +37,7 @@ USA.
 		    (xml->octets (->request request 'XML-RPC)))))
     (if (not (= 200 (http-response-status response)))
 	(error "HTTP error:" (http-response-reason response)))
-    (xml-rpc:parse-response (read-xml (http-entity-body-port response)))))
+    (xml-rpc:parse-response (read-xml (http-message-body-port response)))))
 
 (define (->request request caller)
   (cond ((or (xml-document? request)