cURL / Mailing Lists / curl-library / Single Mail

curl-library

small addition to easy.c

From: Vadim Lebedev <vadim_at_mbdsys.com>
Date: Fri, 16 Dec 2005 11:47:44 +0100

Hello,

We're using curl libary for Openwengo open sourvce VOIP project....

We had to modify a little bit the lib/easy.c file to recover the socket
CURL created for transaction
I wonder if curl maintaners will accept following small addition to the
lib/easy.c

  /*
 * curl_easy_get_sock() is an external interface that allows an app to get
 * the socket of a session handle.
 */
#ifndef WIN32
typedef int SOCKET;
#endif

CURL_EXTERN SOCKET curl_easy_get_sock(CURL *curl)
{
  struct SessionHandle *data = (struct SessionHandle *)curl;

  if (data->info.httpproxycode != 200)
    return -1;
 
  return (SOCKET) data->state.connects[0]->sockfd;
}

Thanks
Vadim Lebedev
Received on 2005-12-16