Le Vendredi 12 Mars 2010 23:12:15, Willy Tarreau a écrit :
> Interestingly my version behaves differently :
> 
> read(0, "show info\n"..., 8192)         = 10
> write(3, "show info\n"..., 10)          = 10
> select(16, [0 3], [3], [], NULL)        = 3 (in [0 3], out [3])
> read(0, ""..., 8192)                    = 0
> read(3, "Name: HAProxy\nVersion: 1.4.0-3\nRe"..., 8192) = 305
> write(1, "Name: HAProxy\nVersion: 1.4.0-3\nRe"..., 305Name: HAProxy
> 
> => it does not immediately send the shutdown() after read()=0.
> 
> That's the reason why I can't reproduce it. I'll update my socat
> to get the same behaviour.

I've recompiled socat 1.6.0.0 and still have the shutdown() call.
But maybe I've found a solution while looking at the socat code : adding the 
option "ignoreeof" to stdio seems to solve the problem.

echo "show info" | socat unix-connect:/tmp/haproxy.socket stdio,ignoreeof

I'll try it on monday.
Thanks to have taken time for it ;)

-- 
Cyril Bonté

Reply via email to