diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-11 20:55:13 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-11 20:55:13 +0000 |
commit | 2796382b88d85c178c6e2a5119a5ee077c73f200 (patch) | |
tree | 1a34ba6bedf25e2dc3f3db7236cb1a832f758b7a /apps | |
parent | e95b4310623219f14d7badd0a6f146b42e3a85a5 (diff) | |
download | ATCD-2796382b88d85c178c6e2a5119a5ee077c73f200.tar.gz |
*** empty log message ***
Diffstat (limited to 'apps')
-rw-r--r-- | apps/JAWS/ChangeLog | 3 | ||||
-rw-r--r-- | apps/JAWS/server/HTTP_Response.cpp | 20 | ||||
-rw-r--r-- | apps/JAWS/server/HTTP_Response.h | 4 | ||||
-rw-r--r-- | apps/JAWS/server/IO.cpp | 6 |
4 files changed, 19 insertions, 14 deletions
diff --git a/apps/JAWS/ChangeLog b/apps/JAWS/ChangeLog index 20bb468c17f..232ecaffb6d 100644 --- a/apps/JAWS/ChangeLog +++ b/apps/JAWS/ChangeLog @@ -1,5 +1,8 @@ Fri Jul 11 02:15:12 1997 James C Hu <jxh@lambada.cs.wustl.edu> + * server/HTTP_Response.cpp: Changes so that the HEADER is not + rebuilt all the time. + * server/IO.cpp (JAWS_Synch_IO::transmit_file): Changed to use writev () instead of multiple send ()s. diff --git a/apps/JAWS/server/HTTP_Response.cpp b/apps/JAWS/server/HTTP_Response.cpp index a29e6878c76..21cf02fc743 100644 --- a/apps/JAWS/server/HTTP_Response.cpp +++ b/apps/JAWS/server/HTTP_Response.cpp @@ -23,8 +23,8 @@ HTTP_Response::HTTP_Response (HTTP_Request &request, JAWS_IO &io) HTTP_Response::~HTTP_Response (void) { - if (this->HTTP_HEADER != EMPTY_HEADER) - delete [] this->HTTP_HEADER; + // if (this->HTTP_HEADER != EMPTY_HEADER) + // delete [] this->HTTP_HEADER; // The [] is important. Without it, there was a huge memory leak! } @@ -321,16 +321,17 @@ HTTP_Response::build_headers (void) else { HTTP_HEADER = new char[BUFSIZ * 4]; + // We assume that at this point everything is OK - HTTP_HEADER[0] = '\0'; - HTTP_HEADER_LENGTH = 0; + if (! this->request_.cgi ()) + HTTP_HEADER = "HTTP/1.0 200 OK\r\n" + "Content-type: text/html\r\n\r\n"; + else + HTTP_HEADER = "HTTP/1.0 200 OK\r\n"; - HTTP_HEADER_LENGTH += - ACE_OS::sprintf(HTTP_HEADER, "%s %d %s\r\n", - this->request_.version (), - this->request_.status (), - this->request_.status_string ()); + HTTP_HEADER_LENGTH = ACE_OS::strlen (HTTP_HEADER); +#if 0 const char *date_ptr = HTTP_Helper::HTTP_date (); if (date_ptr != 0) @@ -343,6 +344,7 @@ HTTP_Response::build_headers (void) ACE_OS::sprintf(HTTP_HEADER+HTTP_HEADER_LENGTH, "Content-type: %s\r\n\r\n", "text/html"); +#endif } HTTP_TRAILER = ""; diff --git a/apps/JAWS/server/HTTP_Response.h b/apps/JAWS/server/HTTP_Response.h index 65dfd0c85f5..0ddbf7268d1 100644 --- a/apps/JAWS/server/HTTP_Response.h +++ b/apps/JAWS/server/HTTP_Response.h @@ -62,15 +62,15 @@ private: // creates the appropriate header information for responses. private: - // James, please document this. - JAWS_IO &io_; HTTP_Request &request_; + // The IO and Request objects associated with this re char *HTTP_HEADER; char *HTTP_TRAILER; int HTTP_HEADER_LENGTH; int HTTP_TRAILER_LENGTH; + // HTTP Headers and trailers. }; #endif /* HTTP_RESPONSE_H */ diff --git a/apps/JAWS/server/IO.cpp b/apps/JAWS/server/IO.cpp index c2e0c2b8fc4..b58cdf3d13b 100644 --- a/apps/JAWS/server/IO.cpp +++ b/apps/JAWS/server/IO.cpp @@ -139,10 +139,10 @@ JAWS_Synch_IO::transmit_file (const char *filename, iov[iovcnt].iov_len = trailer_size; iovcnt++; } - if (ACE_OS::writev (this->handle_, iov, iovcnt) == 0) - this->handler_->transmit_file_complete (); - else + if (ACE_OS::writev (this->handle_, iov, iovcnt) < 0) result = -1; + else + this->handler_->transmit_file_complete (); #endif } |