From 89167cba185d1e7831cc8518e235ceb019ca5f7c Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Fri, 9 May 2003 03:22:37 +0000 Subject: fix error when server closes connection immediately git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/branches/release-1.3.0@502 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_http.c b/plugins/check_http.c index d13050a..c0c2b41 100644 --- a/plugins/check_http.c +++ b/plugins/check_http.c @@ -627,16 +627,21 @@ check_http (void) pagesize += i; } - if (i < 0) { + if (i < 0 && errno != ECONNRESET) { #ifdef HAVE_SSL - sslerr=SSL_get_error(ssl, i); - if ( sslerr == SSL_ERROR_SSL ) { - terminate (STATE_WARNING, "Client Certificate Required\n"); - } else { + if (use_ssl) { + sslerr=SSL_get_error(ssl, i); + if ( sslerr == SSL_ERROR_SSL ) { + terminate (STATE_WARNING, "Client Certificate Required\n"); + } else { + terminate (STATE_CRITICAL, "Error in recv()"); + } + } + else { +#endif terminate (STATE_CRITICAL, "Error in recv()"); +#ifdef HAVE_SSL } -#else - terminate (STATE_CRITICAL, "Error in recv()"); #endif } -- cgit v0.10-9-g596f