diff options
author | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-11 07:15:08 +0000 |
---|---|---|
committer | jxh <jxh@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-07-11 07:15:08 +0000 |
commit | 01614696a1acdc3c8aa24f36b88b3b1cc093a4ca (patch) | |
tree | b967b7f631fd4e03b4fd99208d3f1ff2376982e1 /apps/JAWS/server/IO.cpp | |
parent | 6ddfae317ecae4992607f03db981c7d6aa773b75 (diff) | |
download | ATCD-01614696a1acdc3c8aa24f36b88b3b1cc093a4ca.tar.gz |
Use writev.
Diffstat (limited to 'apps/JAWS/server/IO.cpp')
-rw-r--r-- | apps/JAWS/server/IO.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/apps/JAWS/server/IO.cpp b/apps/JAWS/server/IO.cpp index 8ec0af8e46f..c2e0c2b8fc4 100644 --- a/apps/JAWS/server/IO.cpp +++ b/apps/JAWS/server/IO.cpp @@ -105,15 +105,45 @@ JAWS_Synch_IO::transmit_file (const char *filename, if (result == ACE_Filecache_Handle::SUCCESS) { +#if 0 ACE_SOCK_Stream stream; stream.set_handle (this->handle_); if ((stream.send_n (header, header_size) == header_size) - && ((u_long) stream.send_n (handle.address (), handle.size ()) == handle.size ()) + && ((u_long) stream.send_n (handle.address (), handle.size ()) + == handle.size ()) && (stream.send_n (trailer, trailer_size) == trailer_size)) this->handler_->transmit_file_complete (); else - result = -1; + result = -1; +#else + // Attempting to use writev + // Is this faster? + struct iovec iov[3]; + int iovcnt = 0; + if (header_size > 0) + { + iov[iovcnt].iov_base = (char *) header; + iov[iovcnt].iov_len = header_size; + iovcnt++; + } + if (handle.size () > 0) + { + iov[iovcnt].iov_base = (char *) handle.address (); + iov[iovcnt].iov_len = handle.size (); + iovcnt++; + } + if (trailer_size > 0) + { + iov[iovcnt].iov_base = (char *) trailer; + iov[iovcnt].iov_len = trailer_size; + iovcnt++; + } + if (ACE_OS::writev (this->handle_, iov, iovcnt) == 0) + this->handler_->transmit_file_complete (); + else + result = -1; +#endif } if (result != ACE_Filecache_Handle::SUCCESS) |