|
From: Leif M. <le...@ta...> - 2004-07-01 04:12:39
|
Venkatesh,
Ok, I think I know what the problem is. I found this message:
http://lists.parisc-linux.org/pipermail/parisc-linux/2004-March/022504.html
It comments on the EWOULDBLOCK and EAGAIN constants not being
equal on HPUX like they are on Linux. I am testing for EWOULDBLOCK,
but reviewing the accept man page, it looks like I should be testing for
EAGAIN.
Could try out a couple more changes to the code and let me know how they
work out?
The first is to modify the tests just after the accept call on or
about wrapper.c:552
Old:
---
if (sd == INVALID_SOCKET) {
rc = wrapperGetLastError();
if (rc == EWOULDBLOCK) {
/* There are no incomming sockets right now. */
return;
} else {
if (wrapperData->isDebugging) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket creation failed. (%s)", getLastErrorText());
}
return;
}
}
---
New:
---
if (sd == INVALID_SOCKET) {
rc = wrapperGetLastError();
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno 11 = %s", strerror(11));
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno EWOULDBLOCK = %d = %s", EWOULDBLOCK,
strerror(EWOULDBLOCK));
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"errno EAGAIN = %d = %s", EAGAIN, strerror(EAGAIN));
/* EWOULDBLOCK != EAGAIN on some platforms. */
if ((rc == EWOULDBLOCK) || (rc == EAGAIN)) {
/* There are no incomming sockets right now. */
return;
} else {
if (wrapperData->isDebugging) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket creation failed. (%s)", getLastErrorText());
}
return;
}
}
---
I am expecting that EAGAIN = 11 on your system. If not, then I would
appreciate
it if you could figure out what constant is = 11 on your machine.
Assuming for now
that it is, then the patch above and the one that follows should fix
your problem.
The second patch is for the test just after the recv call at or around
line 793.
Old:
---
len = recv(sd, &c, 1, 0);
if (len == SOCKET_ERROR) {
err = wrapperGetLastError();
if (wrapperData->isDebugging) {
if ((err != EWOULDBLOCK) && (err != ENOTSOCK) && (err !=
ECONNRESET)) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket read failed. (%s)", getLastErrorText());
wrapperProtocolClose();
}
}
---
New:
---
len = recv(sd, &c, 1, 0);
if (len == SOCKET_ERROR) {
err = wrapperGetLastError();
if (wrapperData->isDebugging) {
if ((err != EWOULDBLOCK) && (err != EAGAIN)
&& (err != ENOTSOCK) && (err != ECONNRESET)) {
log_printf(WRAPPER_SOURCE_PROTOCOL, LEVEL_DEBUG,
"socket read failed. (%s)", getLastErrorText());
wrapperProtocolClose();
}
}
---
Cheers,
Leif
Venkatesh Sellappa wrote:
>Hi List,
>
>I think we got a little bit more visibility on this.
>Having made the changes to wrapper.c and re-compiling.
>I still get the same error.
>
>The value of EWOULDBLOCK in this case is not 11 but 246.
>
>I have mailed you the log file with all the gory details.
>
>Cheers,
>
>
>
<snip>
|