改名
This commit is contained in:
@@ -136,9 +136,7 @@ class Curl extends ClientAbstracts
|
||||
*/
|
||||
private function execute($curl): Result|bool|array|string
|
||||
{
|
||||
defer(function () {
|
||||
$this->cleanData();
|
||||
});
|
||||
defer(fn() => $this->cleanData());
|
||||
$output = curl_exec($curl);
|
||||
if ($output === false) {
|
||||
return $this->fail(400, curl_error($curl));
|
||||
|
||||
@@ -185,9 +185,7 @@ class Http2 extends Component
|
||||
$request->headers = array_merge($request->headers, [
|
||||
'Host' => $domain
|
||||
]);
|
||||
defer(function () use ($domain, $path, $request, $method) {
|
||||
$this->channel->push($request, 'request.' . $method . $path);
|
||||
});
|
||||
defer(fn() => $this->channel->push($request, 'request.' . $method . $path));
|
||||
return $this->doRequest($request, $domain, $isSsl, $timeout);
|
||||
}
|
||||
|
||||
@@ -217,9 +215,7 @@ class Http2 extends Component
|
||||
private function doRequest(Request $request, $domain, $ssl, $timeout): mixed
|
||||
{
|
||||
$client = $this->getClient($domain, $ssl, $timeout);
|
||||
defer(function () use ($client, $domain) {
|
||||
$this->channel->push($client, 'http2.' . $domain);
|
||||
});
|
||||
defer(fn() => $this->channel->push($client, 'http2.' . $domain));
|
||||
$client->send($request);
|
||||
if (Context::getContext('http2isRecv') === false) {
|
||||
return null;
|
||||
|
||||
+1
-3
@@ -50,9 +50,7 @@ class Client extends Component
|
||||
if ($isSend === false) {
|
||||
return $this->addError($this->client->errMsg . '(' . $this->client->errCode . ')');
|
||||
}
|
||||
defer(function () {
|
||||
$this->clientRecover();
|
||||
});
|
||||
defer(fn() => $this->clientRecover());
|
||||
if (is_bool($unpack = Json::decode($this->client->recv()))) {
|
||||
$unpack = $this->addError('Service return data format error(500)');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user