/* Sends data over the connected socket. Use after successful curl_easy_perform() with CURLOPT_CONNECT_ONLY option.  */
CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer, size_t buflen, size_t *n)
/* Sends data over the connected socket. Use after successful curl_easy_perform() with CURLOPT_CONNECT_ONLY option.  */
CURLcode curl_easy_send(struct Curl_easy *data, const void *buffer, size_t buflen, size_t *n)
{
  curl_socket_t sfd;
  CURLcode result;
  ssize_t n1;
  struct connectdata *c = NULL;
  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_write(c, sfd, buffer, buflen, &n1);
  if(n1 == -1)
    return CURLE_SEND_ERROR;
  if(!result && !n1)
    return CURLE_AGAIN;
  *n = (size_t)n1;
  return result;
}