Hiya,

On Wed, Jan 31, 2007 at 01:00:01PM +0300, генерал Пурпоз wrote:
>   No solution to the failing "socket::large_writes" test yet, but I've
>   narrowed the culprit to the "ne_sock_read()" function.
> 
>   It fails for me in a peculiar way. Up to the message size of 65904
>   bytes it works OK. For N of 1<=N<=120 the received message of
>   65904+N bytes has N bytes of stale data at it's end and the
>   "unexpected data: [got] vs [should be]" is printed out. If N is
>   bigger still - the "ne_sock_read()" fails immediately and the
>   "broken pipe" is reported.

This is interesting.  It could be there is some issue on QNX with large 
buffers being passed to send() or recv().  Do you have an "strace" 
command (or equivalent) to trace system calls?

Could you try a patch like this:

Index: src/ne_socket.c
===================================================================
--- src/ne_socket.c     (revision 1148)
+++ src/ne_socket.c     (working copy)
@@ -493,6 +493,8 @@
     ret = readable_raw(sock, sock->rdtimeout);
     if (ret) return ret;
 
+    if (len > 8192) len = 8192;
+
     do {
        ret = recv(sock->fd, buffer, len, 0);
     } while (ret == -1 && NE_ISINTR(ne_errno));

and if that has no effect, try doing the same thing in the write_raw() 
function instead.

>   I think it's down to the way the buffering happens on QNX4.
>   I wonder why the initial LARGE_SIZE of 123456 bytes works for the
>   "socket-ssl" test. The value is obviously chosen "out of thin air",
>   while my 65904 "breakage point" (I speculate still) may be somehow
>   related to the "lo0"'s MTU (which is ~32790, do not remember
>   exactly). I'm curious how the test would work over the "en1"
>   interface with the MTU of 1500...

A difference with the SSL test is probably that the actual read() and 
write() calls made to the socket will use smaller buffers.
> 
>   Hope to find the bulletproof solution. Bebakson...
> 
>   By the way, I could not find where you actually define the "sread()"
>   and the "swrite()".
>   All I can see they are present in the "struct iofns {}"
>   Please comment.

The function pointers are set up in the iofns structure declarations: 
iofns_raw and iofns_ssl; these are used in ne_sock_create() etc to set 
up the sock->ops pointer.

Regards,

joe
_______________________________________________
neon mailing list
[email protected]
http://mailman.webdav.org/mailman/listinfo/neon

Reply via email to