On Sun, Dec 03, 2000 at 02:48:10AM -0600, Sam TH wrote:
> This patch is wrong, however I include it to demonstrate the
> problem. There is no arpa/inet.h on the system I'm on (no inet.h at
> all in fact). The only thing needed from that file is the defintion
> of
> MSG_PEEK (which is defined nowhere in my headers). So I took out the
> include, and added the definition, which fixed the problem. I took the
> define from the headers on my linux box.
>
> However, this is obviously the wrong solution. What's the right one?
I'm cc'ing David Reid who ported neon to BeOS a while ago; I think the
problem is that BeOS doesn't actually support recv() in MSG_PEEK mode,
is that right David? That is a very awkward problem :(
The solution David had was to add buffering to the socket code.
> diff -ur neon-0.7.7/src/socket.c neon/src/socket.c
> --- neon-0.7.7/src/socket.c Thu Oct 26 16:28:45 2000
> +++ neon/src/socket.c Sat Dec 2 22:54:55 2000
> @@ -64,7 +64,7 @@
> #endif
>
> #include <netinet/in.h>
> -#include <arpa/inet.h>
> +/*#include <arpa/inet.h>*/
> #include <netdb.h>
>
> #include <errno.h>
> @@ -103,6 +103,8 @@
> #define ERROR_SSL_STRING (ERR_reason_error_string(ERR_get_error()))
>
> #endif
> +
> +#define MSG_PEEK 0x02
>
> struct nsocket_s {
> int fd;
>
> Thanks
>
> sam th
> sam@uchicago.edu
> http://www.abisource.com/~sam/
> GnuPG Key:
> http://www.abisource.com/~sam/key
Received on Sat Oct 21 14:36:16 2006