#715 https 처리 할 수 있도록 수정, deprecated 표시

This commit is contained in:
akasima 2014-05-15 11:55:36 +09:00
parent 3e12f70956
commit 4778fcc122

View file

@ -8,6 +8,7 @@
* @author NAVER (developers@xpressengine.com)
* @package /classes/httprequest
* @version 0.1
* @deprecated
*/
class XEHttpRequest
{
@ -24,6 +25,12 @@ class XEHttpRequest
*/
var $m_port;
/**
* target scheme
* @var string
*/
var $m_scheme;
/**
* target header
* @var array
@ -34,10 +41,11 @@ class XEHttpRequest
* constructor
* @return void
*/
function XEHttpRequest($host, $port)
function XEHttpRequest($host, $port, $scheme='')
{
$this->m_host = $host;
$this->m_port = $port;
$this->m_scheme = $scheme;
$this->m_headers = array();
}
@ -108,7 +116,13 @@ class XEHttpRequest
{
static $crlf = "\r\n";
$sock = @fsockopen($this->m_host, $this->m_port, $errno, $errstr, $timeout);
$scheme = '';
if($this->m_scheme=='https')
{
$scheme = 'ssl://';
}
$sock = @fsockopen($scheme . $this->m_host, $this->m_port, $errno, $errstr, $timeout);
if(!$sock)
{
return new Object(-1, 'socket_connect_failed');