summaryrefslogtreecommitdiff
path: root/apps/JAWS/server/IO.cpp
diff options
context:
space:
mode:
authorirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-08 06:26:33 +0000
committerirfan <irfan@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-08 06:26:33 +0000
commit2909f3ba89282c1684e46949c5cada1fa22d5ed7 (patch)
treebb8810ce036d83ad2cf4b1faa0ead0292daa311d /apps/JAWS/server/IO.cpp
parent1ffacc1523a5db6bd0fb1910bf5b087fab19f814 (diff)
downloadATCD-2909f3ba89282c1684e46949c5cada1fa22d5ed7.tar.gz
*** empty log message ***
Diffstat (limited to 'apps/JAWS/server/IO.cpp')
-rw-r--r--apps/JAWS/server/IO.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/apps/JAWS/server/IO.cpp b/apps/JAWS/server/IO.cpp
index 099cf062076..ef3e9e0230f 100644
--- a/apps/JAWS/server/IO.cpp
+++ b/apps/JAWS/server/IO.cpp
@@ -97,7 +97,9 @@ JAWS_Synch_IO::receive_file (char *filename,
void
JAWS_Synch_IO::transmit_file (char *filename,
const char *header,
- int header_size)
+ int header_size,
+ const char *trailer,
+ int trailer_size)
{
JAWS_VFS_Node *vf = 0;
VFS::instance ()->open (filename, vf);
@@ -111,17 +113,12 @@ JAWS_Synch_IO::transmit_file (char *filename,
ACE_SOCK_Stream stream;
stream.set_handle (this->handle_);
- int bytes = stream.send_n (header, header_size);
- if (bytes == header_size)
- {
- int bytes = stream.send_n (vf->addr (), vf->size ());
- if (bytes == vf->size ())
- this->handler_->transmit_file_complete ();
- else
- result = HTTP_Status_Code::STATUS_INTERNAL_SERVER_ERROR;
- }
+ if ((stream.send_n (header, header_size) == header_size) &&
+ (stream.send_n (vf->addr (), vf->size ()) == vf->size ()) &&
+ (stream.send_n (trailer, trailer_size) == trailer_size))
+ this->handler_->transmit_file_complete ();
else
- result = HTTP_Status_Code::STATUS_INTERNAL_SERVER_ERROR;
+ result = HTTP_Status_Code::STATUS_INTERNAL_SERVER_ERROR;
}
if (result != HTTP_Status_Code::STATUS_OK)
this->handler_->transmit_file_error (result);
@@ -258,7 +255,9 @@ JAWS_Asynch_IO::receive_file (char *filename,
void
JAWS_Asynch_IO::transmit_file (char *filename,
const char *header,
- int header_size)
+ int header_size,
+ const char *trailer,
+ int trailer_size)
{
ACE_Asynch_Transmit_File::Header_And_Trailer *header_and_trailer = 0;
JAWS_VFS_Node *vf;
@@ -272,8 +271,11 @@ JAWS_Asynch_IO::transmit_file (char *filename,
if (result == HTTP_Status_Code::STATUS_OK)
{
ACE_Message_Block header_mb (header, header_size);
+ ACE_Message_Block trailer_mb (trailer, trailer_size);
header_and_trailer = new ACE_Asynch_Transmit_File::Header_And_Trailer (&header_mb,
- header_size);
+ header_size,
+ &trailer_mb,
+ trailer_size);
ACE_Asynch_Transmit_File tf;
if (tf.open (*this, this->handle_) == -1 ||
tf.transmit_file (vf->get_handle (), // file handle