/* Receives data from the connected socket. Use after successful curl_easy_perform() with CURLOPT_CONNECT_ONLY option. Returns CURLE_OK on success, error code on error.  */
CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen, size_t *n)
/* Receives data from the connected socket. Use after successful curl_easy_perform() with CURLOPT_CONNECT_ONLY option. Returns CURLE_OK on success, error code on error.  */
CURLcode curl_easy_recv(struct Curl_easy *data, void *buffer, size_t buflen, size_t *n)
{
  curl_socket_t sfd;
  CURLcode result;
  ssize_t n1;
  struct connectdata *c;
  if(Curl_is_in_callback(data))
    return CURLE_RECURSIVE_API_CALL;
  result = easy_connection(data, &sfd, &c);
  if(result)
    return result;
  *n = 0;
  result = Curl_read(c, sfd, buffer, buflen, &n1);
  if(result)
    return result;
  *n = (size_t)n1;
  return CURLE_OK;
}