public function RequestMediator::readRequestBody

Read data from the request body and send it to curl

Parameters

resource $ch Curl handle:

resource $fd File descriptor:

int $length Amount of data to read:

Return value

string

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Curl/RequestMediator.php, line 113

Class

RequestMediator
Mediator between curl handles and request objects

Namespace

Guzzle\Http\Curl

Code

public function readRequestBody($ch, $fd, $length) {
  $read = '';
  if ($this->request
    ->getBody()) {
    $read = $this->request
      ->getBody()
      ->read($length);
    if ($this->emitIo) {
      $this->request
        ->dispatch('curl.callback.read', array(
        'request' => $this->request,
        'read' => $read,
      ));
    }
  }
  return !$read ? '' : $read;
}