From 7d2f65002abd21de9c52b362039e29fbad361cac Mon Sep 17 00:00:00 2001 From: Henrik Andersson Date: Thu, 13 Jun 2013 11:01:55 +0000 Subject: [PATCH] Make sure we don't spam log with failed send() messages if we already have detected a network failure. git-svn-id: svn://svn.code.sf.net/p/rdesktop/code/rdesktop/trunk@1711 423420c4-83ab-492f-b58f-81f9feb106b5 --- tcp.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tcp.c b/tcp.c index 65a3960..9a254c5 100644 --- a/tcp.c +++ b/tcp.c @@ -3,7 +3,7 @@ Protocol services - TCP layer Copyright (C) Matthew Chapman 1999-2008 Copyright 2005-2011 Peter Astrand for Cendio AB - Copyright 2012 Henrik Andersson for Cendio AB + Copyright 2012-2013 Henrik Andersson for Cendio AB This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -140,11 +140,14 @@ tcp_send(STREAM s) } else { - error("SSL_write: %d (%s)\n", ssl_err, TCP_STRERROR); - g_network_error = True; #ifdef WITH_SCARD scard_unlock(SCARD_LOCK_TCP); #endif + if (g_network_error == True) + return; + + error("SSL_write: %d (%s)\n", ssl_err, TCP_STRERROR); + g_network_error = True; return; } } @@ -161,11 +164,14 @@ tcp_send(STREAM s) } else { - error("send: %s\n", TCP_STRERROR); - g_network_error = True; #ifdef WITH_SCARD scard_unlock(SCARD_LOCK_TCP); #endif + if (g_network_error == True) + return; + + error("send: %s\n", TCP_STRERROR); + g_network_error = True; return; } }