mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-31 15:47:10 +00:00
BUG/MEDIUM: applet: fix reporting of broken write situation
If an applet tries to write to a closed connection, it hangs forever. This results in some "get map" commands on the CLI to leave orphaned connections alive. Now the applet wakeup function detects that the applet still wants to write while the channel is closed for reads, which is the equivalent to the common "broken pipe" situation. In this case, an error is reported on the stream interface, just as it happens with connections trying to perform a send() in a similar situation. With this fix the stats socket is properly released.
This commit is contained in:
parent
aa977ba205
commit
eca572fe7f
@ -1343,6 +1343,14 @@ void stream_sock_read0(struct stream_interface *si)
|
||||
*/
|
||||
void si_applet_wake_cb(struct stream_interface *si)
|
||||
{
|
||||
struct channel *ic = si_ic(si);
|
||||
|
||||
/* If the applet wants to write and the channel is closed, it's a
|
||||
* broken pipe and it must be reported.
|
||||
*/
|
||||
if ((si->flags & SI_FL_WANT_PUT) && (ic->flags & CF_SHUTR))
|
||||
si->flags |= SI_FL_ERR;
|
||||
|
||||
/* update the stream-int, channels, and possibly wake the stream up */
|
||||
stream_int_notify(si);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user