} else {
// Get IP address
$ip = gethostbyname($hostname);
+ //* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, 'ip=' . $ip . ',hostname=' . $hostname . ' - RESOLVED!');
// Count lookup hit
incrementStatsEntry('dns_lookup_hits');
// Set return value to $ip
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("IP detected, cache entry written: %s->%s", $hostname, $ip));
+ $ret = $ip;
} else {
// Network address or broadcast address found
//* DEBUG: */ logDebugMessage(__METHOD__, __LINE__, sprintf("IP %s is possibly a network or broadcast address.", $ip));
// Free result
SQL_FREERESULT($result);
- // Return IP number (let's hope it!
+ // Return IP number (let's hope it)
return $ret;
}
// Initialize array
$response = array('', '', '');
- // Default is not to use proxy
- $useProxy = false;
-
// Default is non-broken HTTP server implementation
$GLOBALS['is_http_server_broken'] = false;
- // Are proxy settins set?
- if (isProxyUsed()) {
- // Then use it
- $useProxy = true;
- } // END - if
-
// Load include
loadIncludeOnce('inc/classes/resolver.class.php');
$resolver = new HostnameResolver();
// Open connection
- if ($useProxy === true) {
+ if (isProxyUsed() === true) {
// Resolve hostname into IP address
$ip = $resolver->resolveHostname(compileRawCode(getProxyHost()));
// Connect to host directly
$fp = fsockopen($ip, $port, $errno, $errdesc, 30);
}
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ip=' . $ip . ',host=' . $host . ',isProxyUsed()=' . intval(isProxyUsed()));
// Is there a link?
if (!is_resource($fp)) {
}
// Do we use proxy?
- if ($useProxy === true) {
+ if (isProxyUsed() === true) {
// Setup proxy tunnel
$response = setupProxyTunnel($host, $port, $fp);
// No response, maybe timeout
$response = array('', '', '');
logDebugMessage(__FUNCTION__, __LINE__, 'Invalid empty response array, maybe timed out?');
- } elseif ((substr(strtolower($response[0]), 0, 11) == 'proxy-agent') && ($useProxy === true)) {
+ } elseif ((substr(strtolower($response[0]), 0, 11) == 'proxy-agent') && (isProxyUsed() === true)) {
// Proxy header detected, so remove two lines
array_shift($response);
array_shift($response);
$code = bigintval($codeArray[0]);
} elseif (!empty($response[0])) {
// Merge response together
+ die('response=<pre>'.print_r($response,true).'</pre>');
$parts = explode('|', implode('', $response));
// If we have only one part, we got an error
{%template,YesNoSelectionBox=set_all%}
</div>
<div class="bottom" style="padding-top:3px;padding-bottom:3px">
- {--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_MAX_RELOAD_TIME--} ({--TIME_UNIT--})<br />
- $content[network_max_reload_time] ({%pipe,translateTimeUnit=$content[network_type_reload_time_unit]%})
+ {--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_MAX_RELOAD_TIME--} ({%pipe,translateTimeUnit=$content[network_type_reload_time_unit]%})<br />
+ $content[network_max_reload_time]
</div>
<div class="bottom" style="padding-top:3px;padding-bottom:3px">
{--ADMIN_CONFIG_NETWORK_HANDLER_TYPE_MIN_WAITING_TIME--}<br />