Module: nagvis
Branch: master
Commit: e58e64c0a07dd9efd5479c8090a08c9ec90f5381
URL:    
http://nagvis.git.sourceforge.net/git/gitweb.cgi?p=nagvis/nagvis;a=commit;h=e58e64c0a07dd9efd5479c8090a08c9ec90f5381

Author: Lars Michelsen <[email protected]>
Date:   Wed Nov 10 18:29:12 2010 +0100

Livestatus backend: Better error handling when writing to livestatus socket

---

 .../core/classes/GlobalBackendmklivestatus.php     |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/share/server/core/classes/GlobalBackendmklivestatus.php 
b/share/server/core/classes/GlobalBackendmklivestatus.php
index 6b9eb68..16fb6ff 100644
--- a/share/server/core/classes/GlobalBackendmklivestatus.php
+++ b/share/server/core/classes/GlobalBackendmklivestatus.php
@@ -194,7 +194,10 @@ class GlobalBackendmklivestatus implements 
GlobalBackendInterface {
                // Query to get a json formated array back
                // Use KeepAlive with fixed16 header
                $query .= "OutputFormat:json\nKeepAlive: on\nResponseHeader: 
fixed16\n\n";
+               // Disable regular error reporting to suppress php error 
messages
+               $oldLevel = error_reporting(0);
                $write = fwrite($this->SOCKET, $query);
+               error_reporting($oldLevel);
 
                if($write=== false)
                        throw new 
BackendConnectionProblem(GlobalCore::getInstance()->getLang()->getText('Problem 
while writing to socket [SOCKET] in backend [BACKENDID]: [MSG]',


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to