return 1;
}
+static forceinline int sc_ep_rcv_ex(const struct stconn *sc)
+{
+ return ((tick_isset(sc->sedesc->lra) && sc_rcv_may_expire(sc))
+ ? tick_add_ifset(sc->sedesc->lra, sc->ioto)
+ : TICK_ETERNITY);
+}
+
+static forceinline int sc_ep_snd_ex(const struct stconn *sc)
+{
+ return ((tick_isset(sc->sedesc->fsb) && sc_snd_may_expire(sc))
+ ? tick_add_ifset(sc->sedesc->fsb, sc->ioto)
+ : TICK_ETERNITY);
+}
+
static inline void sc_check_timeouts(const struct stconn *sc)
{
- if (likely(sc_rcv_may_expire(sc)) && unlikely(tick_is_expired(sc_ep_rcv_ex(sc), now_ms)))
+ if (unlikely(tick_is_expired(sc_ep_rcv_ex(sc), now_ms)))
sc_ic(sc)->flags |= CF_READ_TIMEOUT;
- if (likely(sc_snd_may_expire(sc)) && unlikely(tick_is_expired(sc_ep_snd_ex(sc), now_ms)))
+ if (unlikely(tick_is_expired(sc_ep_snd_ex(sc), now_ms)))
sc_oc(sc)->flags |= CF_WRITE_TIMEOUT;
}
return se_ff_data(sc->sedesc);
}
-static forceinline int sc_ep_rcv_ex(const struct stconn *sc)
-{
- return (tick_isset(sc->sedesc->lra)
- ? tick_add_ifset(sc->sedesc->lra, sc->ioto)
- : TICK_ETERNITY);
-}
-
-static forceinline int sc_ep_snd_ex(const struct stconn *sc)
-{
- return (tick_isset(sc->sedesc->fsb)
- ? tick_add_ifset(sc->sedesc->fsb, sc->ioto)
- : TICK_ETERNITY);
-}
-
/* Returns the stream endpoint from an connector, without any control */
static inline void *__sc_endp(const struct stconn *sc)
{
update_exp_and_leave:
/* Note: please ensure that if you branch here you disable SC_FL_DONT_WAKE */
- t->expire = (tick_is_expired(t->expire, now_ms) ? 0 : t->expire);
-
- if (likely(sc_rcv_may_expire(scf)))
- t->expire = tick_first(t->expire, sc_ep_rcv_ex(scf));
- if (likely(sc_snd_may_expire(scf)))
- t->expire = tick_first(t->expire, sc_ep_snd_ex(scf));
- if (likely(sc_rcv_may_expire(scb)))
- t->expire = tick_first(t->expire, sc_ep_rcv_ex(scb));
- if (likely(sc_snd_may_expire(scb)))
- t->expire = tick_first(t->expire, sc_ep_snd_ex(scb));
-
if (!req->analysers)
req->analyse_exp = TICK_ETERNITY;
if (!res->analysers)
(!tick_isset(req->analyse_exp) || tick_is_expired(req->analyse_exp, now_ms)))
req->analyse_exp = tick_add(now_ms, 5000);
+ t->expire = (tick_is_expired(t->expire, now_ms) ? 0 : t->expire);
+ t->expire = tick_first(t->expire, sc_ep_rcv_ex(scf));
+ t->expire = tick_first(t->expire, sc_ep_snd_ex(scf));
+ t->expire = tick_first(t->expire, sc_ep_rcv_ex(scb));
+ t->expire = tick_first(t->expire, sc_ep_snd_ex(scb));
t->expire = tick_first(t->expire, req->analyse_exp);
-
t->expire = tick_first(t->expire, res->analyse_exp);
-
t->expire = tick_first(t->expire, s->conn_exp);
if (unlikely(tick_is_expired(t->expire, now_ms))) {