Skip to content

Commit

Permalink
FileHandler::getRemoteResource()에서 타임아웃 설정 사용시 존재하지 않는 메소드 호출 현상 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
kijin committed Jun 13, 2015
1 parent e49f1b1 commit 1392a1d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions classes/file/FileHandler.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $c
{
$oRequest = new HTTP_Request(__PROXY_SERVER__);
$oRequest->setMethod('POST');
$oRequest->_timeout = $timeout;
$oRequest->addPostData('arg', serialize(array('Destination' => $url, 'method' => $method, 'body' => $body, 'content_type' => $content_type, "headers" => $headers, "post_data" => $post_data)));
}
else
Expand Down Expand Up @@ -571,7 +570,15 @@ function getRemoteResource($url, $body = null, $timeout = 3, $method = 'GET', $c
if($body)
$oRequest->setBody($body);
}
$oRequest->setConfig('timeout', $timeout);

if(method_exists($oRequest, 'setConfig'))
{
$oRequest->setConfig('timeout', $timeout);
}
elseif(property_exists($oRequest, '_timeout'))
{
$oRequest->_timeout = $timeout;
}

$oResponse = $oRequest->sendRequest();

Expand Down

0 comments on commit 1392a1d

Please sign in to comment.