Skip to content

Commit

Permalink
HTTP_REQUEST
Browse files Browse the repository at this point in the history
  • Loading branch information
pranjal710 committed Oct 21, 2012
1 parent e8a0565 commit dae63da
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pranjal710/osrf/lib/OsrfSession.php
Expand Up @@ -87,12 +87,11 @@ function loadFieldmapper($option)
*/
function checkhost()
{
$ch_idl = curl_init($this->fm_IDL);
curl_setopt($ch_idl, CURLOPT_NOBODY, true);
curl_exec($ch_idl);
$retcode = curl_getinfo($ch_idl, CURLINFO_HTTP_CODE);
/** $retcode > 400 -> not found, $retcode = 200, found. **/
curl_close($ch_idl);
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2($this->fm_IDL, HTTP_Request2::METHOD_GET);
$response = $request->send();
$retcode = $response->getStatus();
/** $retcode = 400 -> not found, $retcode = 200, found. **/
return $retcode;
}
/**
Expand All @@ -118,4 +117,4 @@ function request()
return $msg->send();
}
}
?>
?>

0 comments on commit dae63da

Please sign in to comment.