chn->flags &= ~CF_AUTO_CONNECT;
}
-/* Installs <func> as a hijacker on the channel <b> for session <s>. The hijack
- * flag is set, and the function called once. The function is responsible for
- * clearing the hijack bit. It is possible that the function clears the flag
- * during this first call.
- */
-static inline void channel_install_hijacker(struct session *s,
- struct channel *chn,
- void (*func)(struct session *, struct channel *))
-{
- chn->hijacker = func;
- chn->flags |= CF_HIJACK;
- func(s, chn);
-}
-
-/* Releases the channel from hijacking mode. Often used by the hijack function */
-static inline void channel_stop_hijacker(struct channel *chn)
-{
- chn->flags &= ~CF_HIJACK;
-}
-
/* allow the consumer to try to establish a new connection. */
static inline void channel_auto_connect(struct channel *chn)
{
* CF_SHUTR, CF_SHUTW
*
* - persistent control flags managed only by application level :
- * CF_SHUT*_NOW, CF_*_ENA, CF_HIJACK
+ * CF_SHUT*_NOW, CF_*_ENA
*
* The flags have been arranged for readability, so that the read and write
* bits have the same position in a byte (read being the lower byte and write
#define CF_SHUTW_NOW 0x00004000 /* the consumer must shut down for writes ASAP */
#define CF_AUTO_CLOSE 0x00008000 /* producer can forward shutdown to other side */
-/* When either CF_SHUTR_NOW or CF_HIJACK is set, it is strictly forbidden for
- * the producer to alter the buffer contents. When CF_SHUTW_NOW is set, the
- * consumer is free to perform a shutw() when it has consumed the last contents,
- * otherwise the session processor will do it anyway.
+/* When CF_SHUTR_NOW is set, it is strictly forbidden for the producer to alter
+ * the buffer contents. When CF_SHUTW_NOW is set, the consumer is free to perform
+ * a shutw() when it has consumed the last contents, otherwise the session processor
+ * will do it anyway.
*
* The SHUT* flags work like this :
*
* 1 1 impossible
*
* The SHUTW_NOW flag should be set by the session processor when SHUTR and AUTO_CLOSE
- * are both set. It may also be set by a hijacker at the end of data. And it may also
- * be set by the producer when it detects SHUTR while directly forwarding data to the
- * consumer.
+ * are both set. And it may also be set by the producer when it detects SHUTR while
+ * directly forwarding data to the consumer.
*
* The SHUTR_NOW flag is mostly used to force the producer to abort when an error is
* detected on the consumer side.
#define CF_STREAMER 0x00010000 /* the producer is identified as streaming data */
#define CF_STREAMER_FAST 0x00020000 /* the consumer seems to eat the stream very fast */
-#define CF_HIJACK 0x00040000 /* the producer is temporarily replaced by ->hijacker */
+/* unused: 0x00040000 */
#define CF_ANA_TIMEOUT 0x00080000 /* the analyser timeout has expired */
#define CF_READ_ATTACHED 0x00100000 /* the read side is attached for the first time */
#define CF_KERN_SPLICING 0x00200000 /* kernel splicing desired for this channel */
int wex; /* expiration date for a write or connect, in ticks */
int rto; /* read timeout, in ticks */
int wto; /* write timeout, in ticks */
- void (*hijacker)(struct session *, struct channel *); /* alternative content producer */
int analyse_exp; /* expiration date for current analysers (if set) */
};
resync_response:
/* Analyse response */
- if (unlikely(s->rep->flags & CF_HIJACK)) {
- /* In inject mode, we wake up everytime something has
- * happened on the write side of the buffer.
- */
- unsigned int flags = s->rep->flags;
-
- if ((s->rep->flags & (CF_WRITE_PARTIAL|CF_WRITE_ERROR|CF_SHUTW)) &&
- !channel_full(s->rep)) {
- s->rep->hijacker(s, s->rep);
- }
-
- if ((s->rep->flags ^ flags) & CF_MASK_STATIC) {
- rpf_last = s->rep->flags;
- goto resync_response;
- }
- }
- else if (((s->rep->flags & ~rpf_last) & CF_MASK_ANALYSER) ||
+ if (((s->rep->flags & ~rpf_last) & CF_MASK_ANALYSER) ||
(s->rep->flags ^ rpf_last) & CF_MASK_STATIC ||
s->si[0].state != rp_cons_last ||
s->si[1].state != rp_prod_last) {
* recent call to channel_abort().
*/
if (!s->req->analysers &&
- !(s->req->flags & (CF_HIJACK|CF_SHUTW|CF_SHUTR_NOW)) &&
+ !(s->req->flags & (CF_SHUTW|CF_SHUTR_NOW)) &&
(s->req->prod->state >= SI_ST_EST) &&
(s->req->to_forward != CHN_INFINITE_FORWARD)) {
- /* This buffer is freewheeling, there's no analyser nor hijacker
+ /* This buffer is freewheeling, there's no analyser
* attached to it. If any data are left in, we'll permit them to
* move.
*/
* happen either because the input is closed or because we want to force a close
* once the server has begun to respond.
*/
- if (unlikely((s->req->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK|CF_AUTO_CLOSE|CF_SHUTR)) ==
+ if (unlikely((s->req->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
(CF_AUTO_CLOSE|CF_SHUTR)))
channel_shutw_now(s->req);
* recent call to channel_abort().
*/
if (!s->rep->analysers &&
- !(s->rep->flags & (CF_HIJACK|CF_SHUTW|CF_SHUTR_NOW)) &&
+ !(s->rep->flags & (CF_SHUTW|CF_SHUTR_NOW)) &&
(s->rep->prod->state >= SI_ST_EST) &&
(s->rep->to_forward != CHN_INFINITE_FORWARD)) {
- /* This buffer is freewheeling, there's no analyser nor hijacker
+ /* This buffer is freewheeling, there's no analyser
* attached to it. If any data are left in, we'll permit them to
* move.
*/
*/
/* first, let's check if the response buffer needs to shutdown(write) */
- if (unlikely((s->rep->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK|CF_AUTO_CLOSE|CF_SHUTR)) ==
+ if (unlikely((s->rep->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_AUTO_CLOSE|CF_SHUTR)) ==
(CF_AUTO_CLOSE|CF_SHUTR)))
channel_shutw_now(s->rep);
if (si->state != SI_ST_EST)
return;
- if ((si->ob->flags & (CF_SHUTW|CF_HIJACK|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
+ if ((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW &&
channel_is_empty(si->ob))
si_shutw(si);
- if ((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK)) == 0 && !channel_full(si->ob))
+ if ((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW)) == 0 && !channel_full(si->ob))
si->flags |= SI_FL_WAIT_DATA;
/* we're almost sure that we need some space if the buffer is not
__FUNCTION__,
si, si->state, si->ib->flags, si->ob->flags);
- if (unlikely(si->state != SI_ST_EST || (ib->flags & (CF_SHUTR|CF_HIJACK|CF_DONT_READ))))
+ if (unlikely(si->state != SI_ST_EST || (ib->flags & (CF_SHUTR|CF_DONT_READ))))
return;
if (channel_full(ib)) {
/* process consumer side */
if (channel_is_empty(si->ob)) {
- if (((si->ob->flags & (CF_SHUTW|CF_HIJACK|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
+ if (((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW) &&
(si->state == SI_ST_EST))
stream_int_shutw(si);
__conn_data_stop_send(conn);
si->ob->wex = TICK_ETERNITY;
}
- if ((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK)) == 0 && !channel_full(si->ob))
+ if ((si->ob->flags & (CF_SHUTW|CF_SHUTW_NOW)) == 0 && !channel_full(si->ob))
si->flags |= SI_FL_WAIT_DATA;
if (si->ob->flags & CF_WRITE_ACTIVITY) {
if ((!(chn->flags & (CF_NEVER_WAIT|CF_SEND_DONTWAIT)) &&
((chn->to_forward && chn->to_forward != CHN_INFINITE_FORWARD) ||
(chn->flags & CF_EXPECT_MORE))) ||
- ((chn->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK)) == CF_SHUTW_NOW))
+ ((chn->flags & (CF_SHUTW|CF_SHUTW_NOW)) == CF_SHUTW_NOW))
send_flag |= MSG_MORE;
ret = conn->xprt->snd_buf(conn, chn->buf, send_flag);
/* Check if we need to close the read side */
if (!(ib->flags & CF_SHUTR)) {
/* Read not closed, update FD status and timeout for reads */
- if ((ib->flags & (CF_HIJACK|CF_DONT_READ)) || channel_full(ib)) {
+ if ((ib->flags & CF_DONT_READ) || channel_full(ib)) {
/* stop reading */
if (!(si->flags & SI_FL_WAIT_ROOM)) {
- if (!(ib->flags & (CF_HIJACK|CF_DONT_READ))) /* full */
+ if (!(ib->flags & CF_DONT_READ)) /* full */
si->flags |= SI_FL_WAIT_ROOM;
conn_data_stop_recv(si->conn);
ib->rex = TICK_ETERNITY;
if (channel_is_empty(ob)) {
/* stop writing */
if (!(si->flags & SI_FL_WAIT_DATA)) {
- if ((ob->flags & (CF_HIJACK|CF_SHUTW_NOW)) == 0)
+ if ((ob->flags & CF_SHUTW_NOW) == 0)
si->flags |= SI_FL_WAIT_DATA;
conn_data_stop_send(si->conn);
ob->wex = TICK_ETERNITY;
if (unlikely(si->state > SI_ST_EST || (ib->flags & CF_SHUTR)))
return;
- if ((ib->flags & (CF_HIJACK|CF_DONT_READ)) || channel_full(ib)) {
+ if ((ib->flags & CF_DONT_READ) || channel_full(ib)) {
/* stop reading */
- if (!(ib->flags & (CF_HIJACK|CF_DONT_READ))) /* full */
+ if (!(ib->flags & CF_DONT_READ)) /* full */
si->flags |= SI_FL_WAIT_ROOM;
conn_data_stop_recv(si->conn);
}
* ->o limit was reached. Maybe we just wrote the last
* chunk and need to close.
*/
- if (((ob->flags & (CF_SHUTW|CF_HIJACK|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
+ if (((ob->flags & (CF_SHUTW|CF_AUTO_CLOSE|CF_SHUTW_NOW)) ==
(CF_AUTO_CLOSE|CF_SHUTW_NOW)) &&
(si->state == SI_ST_EST)) {
si_shutw(si);
goto out_wakeup;
}
- if ((ob->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_HIJACK)) == 0)
+ if ((ob->flags & (CF_SHUTW|CF_SHUTW_NOW)) == 0)
si->flags |= SI_FL_WAIT_DATA;
ob->wex = TICK_ETERNITY;
}