Hi Alex, I've just tested app/main.l + httpGate with fresh development release, it works fine. My patches to httpGate and ssl: # diff -u httpGate.c.orig httpGate.c --- httpGate.c.orig 2012-03-20 12:46:41.000000000 +0600 +++ httpGate.c 2013-01-27 22:16:09.000000000 +0600 @@ -2,6 +2,7 @@ * (c) Software Lab. Alexander Burger */ +#include <sys/socket.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> @@ -15,6 +16,7 @@ #include <sys/stat.h> #include <netdb.h> #include <arpa/inet.h> +#include <netinet/in.h> #include <openssl/pem.h> #include <openssl/ssl.h>
# diff -u ssl.c.orig ssl.c --- ssl.c.orig 2011-10-22 20:29:48.000000000 +0600 +++ ssl.c 2013-01-27 22:13:04.000000000 +0600 @@ -2,6 +2,7 @@ * (c) Software Lab. Alexander Burger */ +#include <sys/socket.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> Best regards, Mansur > Hi all, > > finally, after hours of tracing and debugging, Mansur and I could locate > the problem! > > We found that the socket was unexpectedly in non-blocking mode, causing > the read operation to return nonsense data. > > It resulted from the fact that new sockets returned from accept() in BSD > inherit the flags from the parent socket. From the man page: > > On Linux, the new socket returned by accept() does not inherit file > status flags such as O_NONBLOCK and O_ASYNC from the listening > socket. This behavior differs from the canonical BSD sockets > implementation. Portable programs should not rely on inheritance or > noninheritance of file status flags and always explicitly set all > required flags on the socket returned from accept(). > > Because PicoLisp temporarily sets the socket to non-blocking before > calling accept(), this was inherited to the new socket on FreeBSD (but > not on Linux). > > Released a new version (3.1.1.10) to the repo, and -- as ever -- to > http://software-lab.de/picoLisp.tgz > > ♪♫ Alex > -- > UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe > --