net: net_app: Correctly notify server on TCP disconnection

If a disconnection callback was registered, it is not called
as the check done in net_app is reversed. The disconnection callback
is not called if there are any inactive contexts.
The check should be on any active context.

Signed-off-by: Philémon Jaermann <p.jaermann@gmail.com>
This commit is contained in:
Philémon Jaermann 2018-08-01 21:44:48 +02:00 committed by Jukka Rissanen
parent 3641c25df9
commit c3eea5f6ee

View file

@ -200,7 +200,7 @@ void _net_app_received(struct net_context *net_ctx,
* context do not call the close callback.
*/
for (i = 0; i < CONFIG_NET_APP_SERVER_NUM_CONN; i++) {
if (!ctx->server.net_ctxs[i]) {
if (ctx->server.net_ctxs[i]) {
close = false;
break;
}