diff --git a/net/net_tcp.c b/net/net_tcp.c index 10ee55575f8..ae26ce71459 100644 --- a/net/net_tcp.c +++ b/net/net_tcp.c @@ -810,8 +810,10 @@ static struct tcp_connection* tcpconn_new(int sock, union sockaddr_union* su, c->async->allocated = protos[si->proto].net.async_chunks; c->async->oldest = 0; c->async->pending = 0; - } else - LM_WARN("could not allocate async data for con!\n"); + } else { + LM_ERR("could not allocate async data for con!\n"); + goto error; + } } tcp_connections_no++; diff --git a/net/proto_tcp/proto_tcp.c b/net/proto_tcp/proto_tcp.c index 4d7092d9dce..5c18934be03 100644 --- a/net/proto_tcp/proto_tcp.c +++ b/net/proto_tcp/proto_tcp.c @@ -210,8 +210,13 @@ static int proto_tcp_init(struct proto_info *pi) } /* without async support, there is nothing to init/clean per conn */ - if (tcp_async!=0) + if (tcp_async!=0) { + /* be sure the settings are consistent, like having a minimum 2 value + * if the tcp_async is enbled */ + if (tcp_async_max_postponed_chunks<=1) + tcp_async_max_postponed_chunks = 2; pi->net.async_chunks= tcp_async_max_postponed_chunks; + } return 0; }