Project

General

Profile

« Previous | Next » 

Revision dbd919ec

Added by Chris Buechler about 10 years ago

Don't call growl if the configured address isn't an IP or resolvable
hostname. Avoids 1 minute timeout delay in fsockopen in growl.class. Cuts
that down to about a 20 second timeout. Ticket #4739

View differences:

etc/inc/notices.inc
387 387
	$growl_name = $config['notifications']['growl']['name'];
388 388
	$growl_notification = $config['notifications']['growl']['notification_name'];
389 389
	
390
	if(!empty($growl_ip)) {
390
	if(!empty($growl_ip) && (is_ipaddr($growl_ip) || dns_get_record($growl_ip, DNS_A) || dns_get_record($growl_ip, DNS_AAAA))) {
391 391
		$growl = new Growl($growl_ip, $growl_password, $growl_name);
392 392
		$growl->notify("{$growl_notification}", gettext(sprintf("%s (%s) - Notification", $g['product_name'], $hostname)), "{$message}");
393 393
	}

Also available in: Unified diff