mirror of
https://github.com/friendica/friendica
synced 2025-04-30 09:44:22 +02:00
Curl Response Refactoring
- refactored Network::getCurl() - replaced every Network::getCur() execution with a Curl Response
This commit is contained in:
parent
7c73e8634c
commit
ffbc688797
9 changed files with 30 additions and 30 deletions
|
@ -3089,7 +3089,7 @@ class Diaspora
|
|||
|
||||
logger("transmit: ".$logid."-".$guid." to ".$dest_url." returns: ".$return_code);
|
||||
|
||||
if (!$return_code || (($return_code == 503) && (stristr($postResult->getHeaders(), "retry-after")))) {
|
||||
if (!$return_code || (($return_code == 503) && (stristr($postResult->getHeader(), "retry-after")))) {
|
||||
if (!$no_queue && !empty($contact['contact-type']) && ($contact['contact-type'] != Contact::ACCOUNT_TYPE_RELAY)) {
|
||||
logger("queue message");
|
||||
// queue message for redelivery
|
||||
|
|
|
@ -86,13 +86,14 @@ class PortableContact
|
|||
|
||||
logger('load: ' . $url, LOGGER_DEBUG);
|
||||
|
||||
$s = Network::fetchUrl($url);
|
||||
$fetchresult = Network::fetchUrlFull($url);
|
||||
$s = $fetchresult->getBody();
|
||||
|
||||
logger('load: returns ' . $s, LOGGER_DATA);
|
||||
|
||||
logger('load: return code: ' . Network::getCurl()->getCode(), LOGGER_DEBUG);
|
||||
logger('load: return code: ' . $fetchresult->getReturnCode(), LOGGER_DEBUG);
|
||||
|
||||
if ((Network::getCurl()->getCode() > 299) || (! $s)) {
|
||||
if (($fetchresult->getReturnCode() > 299) || (! $s)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -193,7 +193,7 @@ class Salmon
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (($return_code == 503) && (stristr(Network::getCurl()->getHeaders(), 'retry-after'))) {
|
||||
if (($return_code == 503) && (stristr($postResult->getHeader(), 'retry-after'))) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue