From owner-svn-ports-all@FreeBSD.ORG Sat Sep 27 19:37:57 2014 Return-Path: Delivered-To: svn-ports-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id ECB9FCEE; Sat, 27 Sep 2014 19:37:56 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CE6F6922; Sat, 27 Sep 2014 19:37:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s8RJbuor035418; Sat, 27 Sep 2014 19:37:56 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s8RJbuZd035416; Sat, 27 Sep 2014 19:37:56 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201409271937.s8RJbuZd035416@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Sat, 27 Sep 2014 19:37:56 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org Subject: svn commit: r369417 - in branches/2014Q3/net-mgmt/nrpe: . files X-SVN-Group: ports-branches MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 27 Sep 2014 19:37:57 -0000 Author: bdrewery Date: Sat Sep 27 19:37:55 2014 New Revision: 369417 URL: http://svnweb.freebsd.org/changeset/ports/369417 QAT: https://qat.redports.org/buildarchive/r369417/ Log: MFH: r369416 - Apply patch to fix timed out SSL connections from spinning CPU Tested by: bdrewery Submitted by: kajetan.staszkiewicz@innogames.de Submitted by: ohauer PR: 176438 Approved by: maintainer timeout Modified: branches/2014Q3/net-mgmt/nrpe/Makefile branches/2014Q3/net-mgmt/nrpe/files/patch-src-nrpe.c Directory Properties: branches/2014Q3/ (props changed) Modified: branches/2014Q3/net-mgmt/nrpe/Makefile ============================================================================== --- branches/2014Q3/net-mgmt/nrpe/Makefile Sat Sep 27 19:36:35 2014 (r369416) +++ branches/2014Q3/net-mgmt/nrpe/Makefile Sat Sep 27 19:37:55 2014 (r369417) @@ -3,7 +3,7 @@ PORTNAME= nrpe DISTVERSION= 2.15 -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= net-mgmt MASTER_SITES= SF/nagios/${PORTNAME}-2.x/${PORTNAME}-${PORTVERSION} Modified: branches/2014Q3/net-mgmt/nrpe/files/patch-src-nrpe.c ============================================================================== --- branches/2014Q3/net-mgmt/nrpe/files/patch-src-nrpe.c Sat Sep 27 19:36:35 2014 (r369416) +++ branches/2014Q3/net-mgmt/nrpe/files/patch-src-nrpe.c Sat Sep 27 19:37:55 2014 (r369417) @@ -1,6 +1,15 @@ ---- src/nrpe.c.orig 2013-07-10 21:18:24.000000000 +0000 -+++ src/nrpe.c 2013-07-10 21:20:25.000000000 +0000 -@@ -89,7 +89,9 @@ +--- ./src/nrpe.c.orig 2013-09-06 17:27:13.000000000 +0200 ++++ ./src/nrpe.c 2013-10-05 17:15:33.000000000 +0200 +@@ -30,6 +30,8 @@ + #include "utils.h" + #include "acl.h" + ++#include ++ + #ifdef HAVE_SSL + #include "../include/dh.h" + #endif +@@ -100,7 +102,9 @@ int use_src=FALSE; /* Define parameter for SRC option */ @@ -10,7 +19,38 @@ int main(int argc, char **argv){ -@@ -1673,6 +1675,7 @@ +@@ -969,8 +973,14 @@ + continue; + + /* socket is nonblocking and we don't have a connection yet */ +- if(errno==EAGAIN) ++ if(errno==EAGAIN) { ++ struct pollfd pfd; ++ ++ pfd.fd = sock; ++ pfd.events = POLLIN; ++ poll(&pfd,1,-1); + continue; ++ } + + /* fix for HP-UX 11.0 - just retry */ + if(errno==ENOBUFS) +@@ -1207,9 +1217,13 @@ + if(result==STATE_OK && use_ssl==TRUE){ + if((ssl=SSL_new(ctx))!=NULL){ + SSL_set_fd(ssl,sock); ++ int n = 0; + + /* keep attempting the request if needed */ +- while(((rc=SSL_accept(ssl))!=1) && (SSL_get_error(ssl,rc)==SSL_ERROR_WANT_READ)); ++ while( ((rc=SSL_accept(ssl))!=1) && (SSL_get_error(ssl,rc)==SSL_ERROR_WANT_READ) && n <= 600){ ++ usleep(100000); ++ n++; ++ } + + if(rc!=1){ + syslog(LOG_ERR,"Error: Could not complete SSL handshake. %d\n",SSL_get_error(ssl,rc)); +@@ -1796,6 +1810,7 @@ return OK; } @@ -18,7 +58,7 @@ void complete_SSL_shutdown( SSL *ssl) { /* -@@ -1693,6 +1696,7 @@ +@@ -1816,6 +1831,7 @@ if( SSL_shutdown( ssl)) break; } }