Revision: 7572
http://playerstage.svn.sourceforge.net/playerstage/?rev=7572&view=rev
Author: gbiggs
Date: 2009-04-03 01:52:31 +0000 (Fri, 03 Apr 2009)
Log Message:
-----------
More work for patch #2697041
Modified Paths:
--------------
code/player/trunk/libplayertcp/playertcp_errutils.h
code/player/trunk/libplayertcp/remote_driver.cc
Modified: code/player/trunk/libplayertcp/playertcp_errutils.h
===================================================================
--- code/player/trunk/libplayertcp/playertcp_errutils.h 2009-04-02 23:50:59 UTC
(rev 7571)
+++ code/player/trunk/libplayertcp/playertcp_errutils.h 2009-04-03 01:52:31 UTC
(rev 7572)
@@ -7,6 +7,7 @@
// Joy of joys, even strerror isn't the same for Windows sockets
#if defined (WIN32)
const int ERRNO_EAGAIN = WSAEWOULDBLOCK;
+ const int ERRNO_EWOULDBLOCK = WSAEWOULDBLOCK;
#define STRERROR(errMacro,text) {LPVOID errBuffer = NULL; \
FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL, \
ErrNo, 0, (LPTSTR) &errBuffer, 0, NULL); \
@@ -15,4 +16,5 @@
#else
#define STRERROR(errMacro,text) errMacro (text, strerror (ErrNo));
const int ERRNO_EAGAIN = EAGAIN;
+ const int ERRNO_EWOULDBLOCK = EWOULDBLOCK;
#endif
Modified: code/player/trunk/libplayertcp/remote_driver.cc
===================================================================
--- code/player/trunk/libplayertcp/remote_driver.cc 2009-04-02 23:50:59 UTC
(rev 7571)
+++ code/player/trunk/libplayertcp/remote_driver.cc 2009-04-03 01:52:31 UTC
(rev 7572)
@@ -157,17 +157,18 @@
thisnumread = recv(this->sock, banner+numread, sizeof(banner)-numread, 0);
if(thisnumread < 0)
{
- if(ErrNo != ERRNO_EAGAIN)
+ // ErrNo is zero on solaris if the call would block
+ if(ErrNo && ErrNo != ERRNO_EAGAIN && ErrNo != ERRNO_EWOULDBLOCK)
{
// Error on the socket
#if defined (WIN32)
LPVOID buffer = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL,
ErrNo, 0, reinterpret_cast<LPTSTR> (&buffer), 0, NULL);
- PLAYER_MSG1(2, "recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
+ PLAYER_ERROR1("recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
LocalFree(buffer);
#else
- PLAYER_MSG1(2,"recv() failed: %s", strerror(ErrNo));
+ PLAYER_ERROR1("recv() failed: %s", strerror(ErrNo));
#endif
PLAYER_ERROR("error reading banner from remote device");
return(-1);
@@ -267,7 +268,8 @@
thisnumbytes = send(this->sock, reinterpret_cast<const char*>
(buf+numbytes), encode_msglen-numbytes, 0);
if(thisnumbytes < 0)
{
- if(ErrNo != ERRNO_EAGAIN)
+ // ErrNo is zero on solaris if the call would block
+ if(ErrNo && ErrNo != ERRNO_EAGAIN && ErrNo != ERRNO_EWOULDBLOCK)
{
#if defined (WIN32)
LPVOID buffer = NULL;
@@ -306,17 +308,18 @@
thisnumbytes = recv(this->sock, reinterpret_cast<char*> (buf+numbytes),
PLAYERXDR_MSGHDR_SIZE-numbytes, 0);
if(thisnumbytes < 0)
{
- if(ErrNo != ERRNO_EAGAIN)
+ // ErrNo is zero on solaris if the call would block
+ if(ErrNo && ErrNo != ERRNO_EAGAIN && ErrNo != ERRNO_EWOULDBLOCK)
{
// Error on the socket
#if defined (WIN32)
LPVOID buffer = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL,
ErrNo, 0, reinterpret_cast<LPTSTR> (&buffer), 0, NULL);
- PLAYER_MSG1(2, "recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
+ PLAYER_ERROR1("recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
LocalFree(buffer);
#else
- PLAYER_MSG1(2, "recv() failed: %s", strerror(ErrNo));
+ PLAYER_ERROR1("recv() failed: %s", strerror(ErrNo));
#endif
PLAYER_ERROR("error reading message header from remote device");
return(-1);
@@ -362,17 +365,18 @@
thisnumbytes = recv(this->sock, reinterpret_cast<char*>
(buf+PLAYERXDR_MSGHDR_SIZE+numbytes), hdr.size-numbytes, 0);
if(thisnumbytes < 0)
{
- if(ErrNo != ERRNO_EAGAIN)
+ // ErrNo is zero on solaris if the call would block
+ if(ErrNo && ErrNo != ERRNO_EAGAIN && ErrNo != ERRNO_EWOULDBLOCK)
{
// Error on the socket
#if defined (WIN32)
LPVOID buffer = NULL;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM, NULL,
ErrNo, 0, reinterpret_cast<LPTSTR> (&buffer), 0, NULL);
- PLAYER_MSG1(2, "recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
+ PLAYER_ERROR1("recv() failed: %s", reinterpret_cast<LPTSTR> (buffer));
LocalFree(buffer);
#else
- PLAYER_MSG1(2, "recv() failed: %s", strerror(ErrNo));
+ PLAYER_ERROR1("recv() failed: %s", strerror(ErrNo));
#endif
PLAYER_ERROR("error reading message body from remote device");
return(-1);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit