summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>2001-07-13 22:00:08 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>2001-07-13 22:00:08 +0000
commit158df899ff1c6d281ee7fd30e85ac84bb14247db (patch)
tree031d039c15edfc01e3a5f1141e846a537d430354
parent6f7ca7dc55d8c669c1bc473f73c573da6e68a7a0 (diff)
downloadATCD-158df899ff1c6d281ee7fd30e85ac84bb14247db.tar.gz
ChangeLogTag:Fri Jul 13 14:59:18 2001 Alexander Libman <alexander.libman@baltimore.com>
-rw-r--r--ChangeLog53
-rw-r--r--ChangeLogs/ChangeLog-02a53
-rw-r--r--ChangeLogs/ChangeLog-03a53
-rw-r--r--ace/WIN32_Asynch_IO.cpp18
-rw-r--r--ace/WIN32_Asynch_IO.h26
-rw-r--r--ace/WIN32_Proactor.cpp44
6 files changed, 231 insertions, 16 deletions
diff --git a/ChangeLog b/ChangeLog
index 65d290808de..b714c134f09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
+Fri Jul 13 14:59:18 2001 Alexander Libman <alexander.libman@baltimore.com>
+
+ * ace/WIN32_Asynch_IO.h (ACE_WIN32_Asynch_Result):
+ * ace/WIN32_Asynch_IO.cpp (set_error, set_bytes_transferred):
+
+ Added new methods set_error() and set_bytes_transferred().
+ Needed for below changes and new asynchronous SSL stream
+ implementation.
+
+ * ace/WIN32_Proactor.cpp (handle_events):
+
+ Fixed error handling semantics so that it is consistent with the
+ POSIX Proactor error handling semantics.
+
+ (post_completion):
+
+ Pass the amount of bytes transferred and the completion key to
+ the Win32 PostQueuedCompletionStatus() function. The error, if
+ any, will later be extracted in the handle_events() method.
+
Fri Jul 13 15:59:45 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* netsvcs/servers/main.cpp (main): The server was always outputing
@@ -487,7 +507,21 @@ Fri Jul 6 08:36:20 2001 Chad Elliott <elliott_c@ociweb.com>
contain Other. The netsvcs library requires Naming_Context.
Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+
+=======
+>>>>>>> 4.2263
+ * ace/Makefile (LOGGING_FILES): Added support for
+ Log_Msg_UNIX_Syslog.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+<<<<<<< ChangeLog
* ace/Makefile (LOGGING_FILES): Added support for
Log_Msg_UNIX_Syslog.
@@ -501,7 +535,26 @@ Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
reporting this.
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+ * ace/Log_Msg_UNIX_Syslog.{h,cpp}:
+ * ace/Log_Msg.cpp,
+ * ace/OS.h: Added support for a new UNIX syslog backend for the
+ ACE_Log_Msg class. Thanks to Jerry D. De Master
+ <jdemaster@rite-solutions.com> and Robert Davidson
+ <robert@rdavidson.freeserve.co.uk>.
+
+ * ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
+ comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
+ reporting this.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+=======
+>>>>>>> 4.2263
* ace/config-macosx.h: Added a new file courtesy of John
Zorko so that things will work on MacOSX.
diff --git a/ChangeLogs/ChangeLog-02a b/ChangeLogs/ChangeLog-02a
index 65d290808de..b714c134f09 100644
--- a/ChangeLogs/ChangeLog-02a
+++ b/ChangeLogs/ChangeLog-02a
@@ -1,3 +1,23 @@
+Fri Jul 13 14:59:18 2001 Alexander Libman <alexander.libman@baltimore.com>
+
+ * ace/WIN32_Asynch_IO.h (ACE_WIN32_Asynch_Result):
+ * ace/WIN32_Asynch_IO.cpp (set_error, set_bytes_transferred):
+
+ Added new methods set_error() and set_bytes_transferred().
+ Needed for below changes and new asynchronous SSL stream
+ implementation.
+
+ * ace/WIN32_Proactor.cpp (handle_events):
+
+ Fixed error handling semantics so that it is consistent with the
+ POSIX Proactor error handling semantics.
+
+ (post_completion):
+
+ Pass the amount of bytes transferred and the completion key to
+ the Win32 PostQueuedCompletionStatus() function. The error, if
+ any, will later be extracted in the handle_events() method.
+
Fri Jul 13 15:59:45 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* netsvcs/servers/main.cpp (main): The server was always outputing
@@ -487,7 +507,21 @@ Fri Jul 6 08:36:20 2001 Chad Elliott <elliott_c@ociweb.com>
contain Other. The netsvcs library requires Naming_Context.
Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+
+=======
+>>>>>>> 4.2263
+ * ace/Makefile (LOGGING_FILES): Added support for
+ Log_Msg_UNIX_Syslog.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+<<<<<<< ChangeLog
* ace/Makefile (LOGGING_FILES): Added support for
Log_Msg_UNIX_Syslog.
@@ -501,7 +535,26 @@ Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
reporting this.
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+ * ace/Log_Msg_UNIX_Syslog.{h,cpp}:
+ * ace/Log_Msg.cpp,
+ * ace/OS.h: Added support for a new UNIX syslog backend for the
+ ACE_Log_Msg class. Thanks to Jerry D. De Master
+ <jdemaster@rite-solutions.com> and Robert Davidson
+ <robert@rdavidson.freeserve.co.uk>.
+
+ * ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
+ comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
+ reporting this.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+=======
+>>>>>>> 4.2263
* ace/config-macosx.h: Added a new file courtesy of John
Zorko so that things will work on MacOSX.
diff --git a/ChangeLogs/ChangeLog-03a b/ChangeLogs/ChangeLog-03a
index 65d290808de..b714c134f09 100644
--- a/ChangeLogs/ChangeLog-03a
+++ b/ChangeLogs/ChangeLog-03a
@@ -1,3 +1,23 @@
+Fri Jul 13 14:59:18 2001 Alexander Libman <alexander.libman@baltimore.com>
+
+ * ace/WIN32_Asynch_IO.h (ACE_WIN32_Asynch_Result):
+ * ace/WIN32_Asynch_IO.cpp (set_error, set_bytes_transferred):
+
+ Added new methods set_error() and set_bytes_transferred().
+ Needed for below changes and new asynchronous SSL stream
+ implementation.
+
+ * ace/WIN32_Proactor.cpp (handle_events):
+
+ Fixed error handling semantics so that it is consistent with the
+ POSIX Proactor error handling semantics.
+
+ (post_completion):
+
+ Pass the amount of bytes transferred and the completion key to
+ the Win32 PostQueuedCompletionStatus() function. The error, if
+ any, will later be extracted in the handle_events() method.
+
Fri Jul 13 15:59:45 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* netsvcs/servers/main.cpp (main): The server was always outputing
@@ -487,7 +507,21 @@ Fri Jul 6 08:36:20 2001 Chad Elliott <elliott_c@ociweb.com>
contain Other. The netsvcs library requires Naming_Context.
Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+
+=======
+>>>>>>> 4.2263
+ * ace/Makefile (LOGGING_FILES): Added support for
+ Log_Msg_UNIX_Syslog.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+<<<<<<< ChangeLog
* ace/Makefile (LOGGING_FILES): Added support for
Log_Msg_UNIX_Syslog.
@@ -501,7 +535,26 @@ Fri Jul 6 05:44:13 2001 Douglas C. Schmidt <schmidt@tango.doc.wustl.edu>
* ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
reporting this.
+<<<<<<< ChangeLog
+<<<<<<< ChangeLog
+=======
+ * ace/Log_Msg_UNIX_Syslog.{h,cpp}:
+ * ace/Log_Msg.cpp,
+ * ace/OS.h: Added support for a new UNIX syslog backend for the
+ ACE_Log_Msg class. Thanks to Jerry D. De Master
+ <jdemaster@rite-solutions.com> and Robert Davidson
+ <robert@rdavidson.freeserve.co.uk>.
+
+ * ace/SOCK_Dgram.h: Fixed a typo in one of the send() method
+ comments. Thanks to Alain Decamps <Alain.Decamps@PIDPA.be> for
+ reporting this.
+>>>>>>> 4.2247
+=======
+>>>>>>> 4.2257
+
+=======
+>>>>>>> 4.2263
* ace/config-macosx.h: Added a new file courtesy of John
Zorko so that things will work on MacOSX.
diff --git a/ace/WIN32_Asynch_IO.cpp b/ace/WIN32_Asynch_IO.cpp
index 0a9351f3cea..86730f3e2b9 100644
--- a/ace/WIN32_Asynch_IO.cpp
+++ b/ace/WIN32_Asynch_IO.cpp
@@ -88,6 +88,18 @@ ACE_WIN32_Asynch_Result::post_completion (ACE_Proactor_Impl *proactor)
return win32_proactor->post_completion (this);
}
+void
+ACE_WIN32_Asynch_Result::set_bytes_transferred (u_long nbytes)
+{
+ this->bytes_transferred_ = nbytes;
+}
+
+void
+ACE_WIN32_Asynch_Result::set_error (u_long errcode)
+{
+ this->error_ = errcode;
+}
+
ACE_WIN32_Asynch_Result::~ACE_WIN32_Asynch_Result (void)
{
}
@@ -364,6 +376,8 @@ ACE_WIN32_Asynch_Read_Stream::shared_read (ACE_WIN32_Asynch_Read_Stream_Result *
{
u_long bytes_read;
+ result->set_error (0); // Clear error before starting IO.
+
// Initiate the read
int initiate_result = ::ReadFile (result->handle (),
result->message_block ().wr_ptr (),
@@ -601,6 +615,8 @@ ACE_WIN32_Asynch_Write_Stream::shared_write (ACE_WIN32_Asynch_Write_Stream_Resul
{
u_long bytes_written;
+ result->set_error (0); // Clear error before starting IO.
+
// Initiate the write
int initiate_result = ::WriteFile (result->handle (),
result->message_block ().rd_ptr (),
@@ -2152,7 +2168,7 @@ ACE_WIN32_Asynch_Write_Dgram_Result::complete (u_long bytes_transferred,
}
else
{
- size_t len = mb->length ();
+ size_t len = mb->length ();
mb->rd_ptr (len);
bytes_transferred -= len;
}
diff --git a/ace/WIN32_Asynch_IO.h b/ace/WIN32_Asynch_IO.h
index 3b3e247c583..7348967cf4d 100644
--- a/ace/WIN32_Asynch_IO.h
+++ b/ace/WIN32_Asynch_IO.h
@@ -103,6 +103,12 @@ public:
/// Destructor.
virtual ~ACE_WIN32_Asynch_Result (void);
+ /// Simulate error value to use in the post_completion ()
+ void set_error (u_long errcode);
+
+ /// Simulate value to use in the post_completion ()
+ void set_bytes_transferred (u_long nbytes);
+
protected:
/// Constructor.
ACE_WIN32_Asynch_Result (ACE_Handler &handler,
@@ -189,7 +195,7 @@ protected:
* @class ACE_WIN32_Asynch_Read_Stream_Result
*
* @brief This is class provides concrete implementation for
- * ACE_Asynch_Read_Stream::Result class.
+ * ACE_Asynch_Read_Stream::Result class.
*/
class ACE_Export ACE_WIN32_Asynch_Read_Stream_Result : public virtual ACE_Asynch_Read_Stream_Result_Impl,
public ACE_WIN32_Asynch_Result
@@ -349,7 +355,7 @@ protected:
* @class ACE_WIN32_Asynch_Write_Stream_Result
*
* @brief This is class provides concrete implementation for
- * ACE_Asynch_Write_Stream::Result class.
+ * ACE_Asynch_Write_Stream::Result class.
*/
class ACE_Export ACE_WIN32_Asynch_Write_Stream_Result : public virtual ACE_Asynch_Write_Stream_Result_Impl,
public ACE_WIN32_Asynch_Result
@@ -1246,7 +1252,7 @@ public:
* @class ACE_WIN32_Asynch_Read_Dgram_Result
*
* @brief This is class provides concrete implementation for
- * ACE_Asynch_Read_Dgram::Result class.
+ * ACE_Asynch_Read_Dgram::Result class.
*/
class ACE_Export ACE_WIN32_Asynch_Read_Dgram_Result : public virtual ACE_Asynch_Read_Dgram_Result_Impl,
public ACE_WIN32_Asynch_Result
@@ -1264,7 +1270,7 @@ public:
/// Message block which contains the read data
ACE_Message_Block *message_block (void) const;
-
+
/// The address of where the packet came from
int remote_address (ACE_Addr& addr) const;
@@ -1390,10 +1396,10 @@ public:
* errno to get the error code.
*
* Scatter/gather is supported on WIN32 by using the <message_block->cont()>
- * method. Up to IOV_MAX <message_block>'s are supported. Upto
+ * method. Up to IOV_MAX <message_block>'s are supported. Upto
* <message_block->size()> bytes will be read into each <message block> for
* a total of <message_block->total_size()> bytes. All <message_block>'s
- * <wr_ptr>'s will be updated to reflect the added bytes for each
+ * <wr_ptr>'s will be updated to reflect the added bytes for each
* <message_block>
*/
virtual ssize_t recv (ACE_Message_Block *message_block,
@@ -1438,14 +1444,14 @@ protected:
* @class ACE_WIN32_Asynch_Write_Dgram_Result
*
* @brief This is class provides concrete implementation for
- * ACE_Asynch_Write_Dgram::Result class.
+ * ACE_Asynch_Write_Dgram::Result class.
*/
class ACE_Export ACE_WIN32_Asynch_Write_Dgram_Result : public virtual ACE_Asynch_Write_Dgram_Result_Impl,
public ACE_WIN32_Asynch_Result
{
/// Factory class willl have special permissions.
friend class ACE_WIN32_Asynch_Write_Dgram;
-
+
/// Proactor class has special permission.
friend class ACE_WIN32_Proactor;
@@ -1562,7 +1568,7 @@ public:
virtual ~ACE_WIN32_Asynch_Write_Dgram (void);
/** This starts off an asynchronous send. Upto
- * <message_block->total_length()> will be sent. <message_block>'s
+ * <message_block->total_length()> will be sent. <message_block>'s
* <rd_ptr> will be updated to reflect the sent bytes if the send operation
* is successfully completed.
* Return code of 1 means immediate success and <number_of_bytes_sent>
@@ -1572,7 +1578,7 @@ public:
* errno to get the error code.
*
* Scatter/gather is supported on WIN32 by using the <message_block->cont()>
- * method. Up to IOV_MAX <message_block>'s are supported. Upto
+ * method. Up to IOV_MAX <message_block>'s are supported. Upto
* <message_block->length()> bytes will be sent from each <message block>
* for a total of <message_block->total_length()> bytes. All
* <message_block>'s <rd_ptr>'s will be updated to reflect the bytes sent
diff --git a/ace/WIN32_Proactor.cpp b/ace/WIN32_Proactor.cpp
index 3fae3d42c0e..96196418e0c 100644
--- a/ace/WIN32_Proactor.cpp
+++ b/ace/WIN32_Proactor.cpp
@@ -130,7 +130,7 @@ ACE_WIN32_Proactor::create_asynch_read_dgram (void)
0);
return implementation;
}
-
+
ACE_Asynch_Write_Dgram_Impl *
ACE_WIN32_Proactor::create_asynch_write_dgram (void)
{
@@ -519,11 +519,30 @@ ACE_WIN32_Proactor::handle_events (unsigned long milli_seconds)
else
errno = 0;
+ u_long result_err = asynch_result->error ();
+
+ // if "result_err" is 0 than
+ // It is normal OS/WIN32 AIO completion.
+ // We have cleared asynch_result->error_
+ // during shared_read/shared_write.
+ // The real error code is already stored in "errno",
+ // so copy "errno" value to the "result_err"
+ // and pass this "result_err" code
+ // to the application_specific_code ()
+ // else
+ // "result_err" non zero
+ // it means we have "post_completed" result
+ // so pass this "result_err" code
+ // to the application_specific_code ()
+
+ if ( result_err == 0 )
+ result_err = errno ;
+
this->application_specific_code (asynch_result,
bytes_transferred,
result,
(void *) completion_key,
- errno);
+ result_err);
}
return 1;
}
@@ -561,11 +580,26 @@ ACE_WIN32_Proactor::post_completion (ACE_WIN32_Asynch_Result *result)
handle != 0)
ACE_OS::event_signal (&handle);
+ // pass
+ // bytes_transferred
+ // completion_key
+ // to the ::PostQueuedCompletionStatus()
+ // error will be extracted later in handle_events()
+
+ u_long bytes_transferred = 0;
+ const void * completion_key = 0 ;
+
+ if ( result != 0 )
+ {
+ bytes_transferred = result->bytes_transferred ();
+ completion_key = result->completion_key();
+ }
+
// Post a completion
if (::PostQueuedCompletionStatus (this->completion_port_, // completion port
- 0, // number of bytes tranferred
- 0, // completion key
- result // overlapped
+ bytes_transferred, // number of bytes transferred
+ (ULONG) completion_key, // completion key
+ result // overlapped
) == FALSE)
{
delete result;