size_t len, cnt, ofs, last_ofs;
int ret = 0;
+ if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW))))
+ goto out;
+
/* if stopping was requested, close immediately */
if (unlikely(stopping))
goto close;
- if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
- goto close;
-
- /* con closed by server side */
- if ((sc_oc(sc)->flags & CF_SHUTW))
- goto close;
-
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
applet_need_more_data(appctx);
se_need_remote_conn(appctx->sedesc);
applet_have_more_data(appctx);
- return;
+ goto out;
}
HA_SPIN_LOCK(SFT_LOCK, &sft->lock);
}
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
+out:
/* always drain data from server */
co_skip(sc_oc(sc), sc_oc(sc)->output);
return;
close:
- sc_shutw(sc);
- sc_shutr(sc);
+ se_fl_set(appctx->sedesc, SE_FL_EOS|SE_FL_EOI);
}
/*
int ret = 0;
char *p;
+ if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW))))
+ goto out;
+
/* if stopping was requested, close immediately */
if (unlikely(stopping))
goto close;
- /* an error was detected */
- if (unlikely(sc_ic(sc)->flags & CF_SHUTW))
- goto close;
-
- /* con closed by server side */
- if ((sc_oc(sc)->flags & CF_SHUTW))
- goto close;
-
/* if the connection is not established, inform the stream that we want
* to be notified whenever the connection completes.
*/
applet_need_more_data(appctx);
se_need_remote_conn(appctx->sedesc);
applet_have_more_data(appctx);
- return;
+ goto out;
}
HA_SPIN_LOCK(SFT_LOCK, &sft->lock);
}
HA_SPIN_UNLOCK(SFT_LOCK, &sft->lock);
+ out:
/* always drain data from server */
co_skip(sc_oc(sc), sc_oc(sc)->output);
return;
close:
- sc_shutw(sc);
- sc_shutr(sc);
+ se_fl_set(appctx->sedesc, SE_FL_EOS|SE_FL_EOI);
+ goto out;
}
void __sink_forward_session_deinit(struct sink_forward_target *sft)