Re: Server reply formatting (newbie)

David Cary (
Thu, 15 Jan 1998 01:44:56 -0500

Message-Id: <l03130301b0e35996b950@[]>
In-Reply-To: <l03020904b0e3564cd9f4@[]>
Date: Thu, 15 Jan 1998 01:44:56 -0500
From: David Cary <>
Cc: "Jacob W. Anderson" <>
Subject: Re: Server reply formatting (newbie)

I don't quite understand the terminology Jacob W. Anderson uses, but the
example looks a lot like what my CGI program spits out, so I assume I'm
doing roughly the same thing.

None of my programs ever write the "HTTP/1.1 code status" (I think the
Apache server does it for me). (And what's with the inconsistent line
endings ?)
Here is one of my CGI programs:

main(/*int argc, char *argv[]*/){

        cout <<
		"Content-type: text/html\n\n"
        	"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 3.2

... good stuff snipped ...

        cout <<

(This code was copied from a *working* CGI program).

(yes, I know I should do HTML 4.0 -- maybe next week).

Notice that I never tell Apache how long my document will be -- the only
way it could possibly tell where the end of the transmission is to wait for
the stream to actually end -- which happens when close() is called on
stdout when my program ends.

Does this help ?

"Jacob W. Anderson" <>
>I'm trying to connect my java http client through the Apache 1.2
>proxy to my proprietary http/1.1 server.  I can connect just fine,
>but my reponse from the server doesn't seem to be compatible with
>the apache 1.2 proxy.  Essentially, I am writing the following to
>the response stream:
>  HTTP/1.1 code status<CRLF>
>  Content-Type: application/octet-stream<LF>
>  Content-Length: 59<LF>
>  <CRLF>
>  <59 bytes of octets>
>Am I missing some important detail here?  It seems to me that the
>proxy server doesn't know that the end of the stream has been reached.
>Aside from the content-length, is there some other method which is
>expected by servers to indicate EOF (end-of-transmission rather).
>--Jacob W. Anderson (

+ David Cary "" ""
| Future Tech, Unknowns, PCMCIA, digital hologram, <*> O-