Skip to content
9 changes: 6 additions & 3 deletions fw/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ tfw_connection_fill_sk_write_queue(TfwConn *conn, unsigned int mss_now)
*/
tcp_slow_start_after_idle_check(sk);

snd_wnd = tfw_tcp_calc_snd_wnd(sk, mss_now);
/*
* First of all Tempesta FW entails skb from connection write queue
* (all http1 data, control frames, tls alerts and so on for http2),
Expand All @@ -301,9 +302,11 @@ tfw_connection_fill_sk_write_queue(TfwConn *conn, unsigned int mss_now)
return r;
}

r = tfw_h2_make_frames(sk, h2, mss_now, snd_wnd);
if (unlikely(r))
return r;
if (snd_wnd) {
r = tfw_h2_make_frames(sk, h2, mss_now, snd_wnd);
if (unlikely(r))
return r;
}

if (unlikely(!conn->write_queue)) {
/*
Expand Down
8 changes: 1 addition & 7 deletions fw/connection.h
Original file line number Diff line number Diff line change
Expand Up @@ -438,16 +438,10 @@ tfw_connection_live(TfwConn *conn)

#define tfw_srv_conn_live(c) tfw_connection_live((TfwConn *)(c))

static inline void
tfw_connection_get_many(TfwConn *conn, int cnt)
{
atomic_add(cnt, &conn->refcnt);
}

static inline void
tfw_connection_get(TfwConn *conn)
{
tfw_connection_get_many(conn, 1);
atomic_inc(&conn->refcnt);
}

#define TFW_CONNETION_GET_IF(name, cond) \
Expand Down
Loading