connman.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: connman@lists.linux.dev
Cc: Matthias Gerstner <mgerstner@suse.de>
Subject: [PATCH 5/5] dnsproxy: Keep timeout in TCP case even after connection is established
Date: Tue, 25 Jan 2022 10:00:26 +0100	[thread overview]
Message-ID: <20220125090026.5108-6-wagi@monom.org> (raw)
In-Reply-To: <20220125090026.5108-1-wagi@monom.org>

From: Matthias Gerstner <mgerstner@suse.de>

If an outgoing TCP connection succeeds but the remote server never sends
back any data then currently the TCP connection will never be
terminated by connmand.

To prevent this keep the connection timeout of 30 seconds active even
after the connection has been established.
---
 src/dnsproxy.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/dnsproxy.c b/src/dnsproxy.c
index 1ccf36a95a35..cf1d36c74496 100644
--- a/src/dnsproxy.c
+++ b/src/dnsproxy.c
@@ -2375,11 +2375,6 @@ static gboolean tcp_server_event(GIOChannel *channel, GIOCondition condition,
 		server->connected = true;
 		server_list = g_slist_append(server_list, server);
 
-		if (server->timeout > 0) {
-			g_source_remove(server->timeout);
-			server->timeout = 0;
-		}
-
 		for (list = request_list; list; ) {
 			struct request_data *req = list->data;
 			int status;
-- 
2.34.1


  parent reply	other threads:[~2022-01-25  9:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-25  9:00 [PATCH 0/5] dnsproxy: Add input validation checks Daniel Wagner
2022-01-25  9:00 ` [PATCH 1/5] main: Use g_strdup for online_check_ipv{4,6}_url config Daniel Wagner
2022-01-25  9:00 ` [PATCH 2/5] dnsproxy: Update TCP length header Daniel Wagner
2022-01-25  9:00 ` [PATCH 3/5] dnsproxy: Validate input data before using them Daniel Wagner
2022-01-25  9:00 ` [PATCH 4/5] dnsproxy: Avoid 100 % busy loop in TCP server case Daniel Wagner
2022-01-25  9:00 ` Daniel Wagner [this message]
2022-01-25  9:10 ` [PATCH 0/5] dnsproxy: Add input validation checks Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220125090026.5108-6-wagi@monom.org \
    --to=wagi@monom.org \
    --cc=connman@lists.linux.dev \
    --cc=mgerstner@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).