Marco Spinetti wrote:

I have update to latest CVS version, but the problem is still alive.

The only fixes were to the test programs, not to APR itself.

I have discovered that the problem isn't apr_socket_recv, but apr_socket_send.

I call this function in this way:

.....
length = strlen(p->query) + 1;
if (apr_socket_send(sock, p->query, &length) != APR_SUCCESS) {
       apr_socket_close(sock);
      fprintf(stderr, "Num caratteri scritti = %d\n", length);
      .......
}

The print inside if prints 0: so apr_socket_send writes nothing!!!!

If apr_socket_send() returns something other than APR_SUCCESS, you should be examining the retcode and not worrying about how many bytes were sent before the error occurred. Presumably your peer dropped the connection, causing the send operation to fail.


Shall I put apr_socket_send inside a do-while cycle or shall apr_socket_send manage everything?

Put it inside a do-while.



Reply via email to