Skip to content

Commit

Permalink
解决因为CURL版本BUG导致推送成功仍然进行推送重试的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
xiezefan committed Sep 8, 2015
1 parent 30cb6e8 commit b2fc367
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/JPush/JPushClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,16 @@ public function request($url, $data, $header, $method='POST') {
break;
} catch (ConnectionErrorException $e) {
if (strpos($e->getMessage(),'28')) {
throw new APIConnectionException("Response timeout. Your request has probably be received by JPUsh Server,please check that whether need to be pushed again.", true);
throw new APIConnectionException("Response timeout. Your request has probably be received by JPush Server,please check that whether need to be pushed again.", true);
}
if (strpos($e->getMessage(),'56')) {
// resolve error[56 Problem (2) in the Chunked-Encoded data]
throw new APIConnectionException("Response timeout, maybe cause by old CURL version. Your request has probably be received by JPush Server, please check that whether need to be pushed again.", true);
}
if ($retryTimes >= $this->retryTimes) {
throw new APIConnectionException("Connect timeout. Please retry later.");
} else {
$logger->debug("Exception - Message:" . $e->getMessage() . ", Code:" . $e->getCode());
$logger->debug("Retry again send " . $method, array(
"method" => $method,
"uri" => $url,
Expand Down

0 comments on commit b2fc367

Please sign in to comment.