From: Willy Tarreau Date: Mon, 21 May 2012 16:05:40 +0000 (+0200) Subject: MEDIUM: stream_interface: call si_data_close() before releasing the si X-Git-Tag: v1.5-dev12~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4da69a91a014e35b2d3833a09d8053305b4f0908;p=thirdparty%2Fhaproxy.git MEDIUM: stream_interface: call si_data_close() before releasing the si This will ensure that the data layer releases anything previously allocated. --- diff --git a/src/session.c b/src/session.c index 6db9f31c54..7bc2248d1b 100644 --- a/src/session.c +++ b/src/session.c @@ -545,6 +545,7 @@ static int sess_update_st_con_tcp(struct session *s, struct stream_interface *si si->flags &= ~SI_FL_CAP_SPLICE; fd_delete(si_fd(si)); + si_data_close(si); if (si->release) si->release(si); diff --git a/src/sock_raw.c b/src/sock_raw.c index 213d46972c..5194ea441b 100644 --- a/src/sock_raw.c +++ b/src/sock_raw.c @@ -811,6 +811,7 @@ static void sock_raw_shutw(struct stream_interface *si) case SI_ST_TAR: si->state = SI_ST_DIS; + si_data_close(si); if (si->release) si->release(si); default: @@ -845,6 +846,7 @@ static void sock_raw_shutr(struct stream_interface *si) si->state = SI_ST_DIS; si->exp = TICK_ETERNITY; + si_data_close(si); if (si->release) si->release(si); return; diff --git a/src/stream_interface.c b/src/stream_interface.c index c2f7b94f49..ceed602743 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -227,6 +227,7 @@ static void stream_int_shutr(struct stream_interface *si) si->state = SI_ST_DIS; si->exp = TICK_ETERNITY; + si_data_close(si); if (si->release) si->release(si); } @@ -263,6 +264,7 @@ static void stream_int_shutw(struct stream_interface *si) si->state = SI_ST_DIS; /* fall through */ + si_data_close(si); if (si->release) si->release(si); default: