OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
http_curl.cc File Reference
#include "http_client.h"
#include "http_curl.h"
#include <curl/curl.h>
#include <boost/asio.hpp>
#include <boost/bind.hpp>
#include <boost/intrusive_ptr.hpp>
#include <tbb/mutex.h>
Include dependency graph for http_curl.cc:

Go to the source code of this file.

Macros

#define MSG_OUT   stdout /* Send info to stdout, change to stderr if you want */
 

Typedefs

typedef boost::intrusive_ptr
< HttpClientSession
TcpSessionPtr
 

Functions

static int multi_timer_cb (CURLM *multi, long timeout_ms, HttpClient *client)
 
static void mcode_or_die (const char *where, CURLMcode code)
 
static void check_multi_info (GlobalInfo *g)
 
static void event_cb_impl (GlobalInfo *g, TcpSessionPtr session, int action, const boost::system::error_code &error, std::size_t bytes_transferred)
 
static void event_cb (GlobalInfo *g, TcpSessionPtr session, int action, const boost::system::error_code &error, std::size_t bytes_transferred)
 
bool timer_cb (GlobalInfo *g)
 
static void remsock (SockInfo *sock_info, GlobalInfo *g)
 
static bool setsock (SockInfo *sock_info, curl_socket_t s, CURL *e, int act, GlobalInfo *g)
 
static void addsock (curl_socket_t s, CURL *easy, int action, GlobalInfo *g)
 
static int sock_cb (CURL *e, curl_socket_t s, int what, void *cbp, void *sockp)
 
static size_t write_cb (void *ptr, size_t size, size_t nmemb, void *data)
 
static size_t header_cb (void *ptr, size_t size, size_t nmemb, void *data)
 
static size_t read_cb (void *ptr, size_t size, size_t nmemb, void *data)
 
static int prog_cb (void *p, double dltotal, double dlnow, double ult, double uln)
 
static curl_socket_t open_socket (void *data, curlsocktype purpose, struct curl_sockaddr *address)
 
static int close_socket (void *clientp, curl_socket_t item)
 
static int send_perform (ConnInfo *conn, GlobalInfo *g)
 
void del_conn (HttpConnection *connection, GlobalInfo *g)
 
void del_curl_handle (ConnInfo *curl_handle, GlobalInfo *g)
 
ConnInfonew_conn (HttpConnection *connection, GlobalInfo *g, bool header, bool short_timeout, bool reuse)
 
void set_url (ConnInfo *conn, const char *url)
 
void set_header_options (ConnInfo *conn, const char *options)
 
void set_ssl_options (ConnInfo *conn, const char *client_cert, const char *client_cert_type, const char *client_key, const char *ca_cert)
 
void set_post_string (ConnInfo *conn, const char *post, uint32_t len)
 
void set_put_string (ConnInfo *conn, const char *put, uint32_t len)
 
int http_get (ConnInfo *conn, GlobalInfo *g)
 
int http_head (ConnInfo *conn, GlobalInfo *g)
 
int http_put (ConnInfo *conn, GlobalInfo *g)
 
int http_post (ConnInfo *conn, GlobalInfo *g)
 
int http_delete (ConnInfo *conn, GlobalInfo *g)
 
int curl_init (HttpClient *client)
 

Variables

const CurlErrorCategory curl_error_category
 

Macro Definition Documentation

#define MSG_OUT   stdout /* Send info to stdout, change to stderr if you want */

Definition at line 30 of file http_curl.cc.

Typedef Documentation

typedef boost::intrusive_ptr<HttpClientSession> TcpSessionPtr

Definition at line 105 of file http_curl.cc.

Function Documentation

static void addsock ( curl_socket_t  s,
CURL *  easy,
int  action,
GlobalInfo g 
)
static

Definition at line 216 of file http_curl.cc.

Here is the call graph for this function:

static void check_multi_info ( GlobalInfo g)
static

Definition at line 77 of file http_curl.cc.

Here is the call graph for this function:

static int close_socket ( void *  clientp,
curl_socket_t  item 
)
static

Definition at line 334 of file http_curl.cc.

Here is the call graph for this function:

int curl_init ( HttpClient client)

Definition at line 507 of file http_curl.cc.

Here is the call graph for this function:

void del_conn ( HttpConnection connection,
GlobalInfo g 
)

Definition at line 364 of file http_curl.cc.

Here is the call graph for this function:

void del_curl_handle ( ConnInfo curl_handle,
GlobalInfo g 
)

Definition at line 378 of file http_curl.cc.

static void event_cb ( GlobalInfo g,
TcpSessionPtr  session,
int  action,
const boost::system::error_code &  error,
std::size_t  bytes_transferred 
)
static

Definition at line 129 of file http_curl.cc.

Here is the call graph for this function:

static void event_cb_impl ( GlobalInfo g,
TcpSessionPtr  session,
int  action,
const boost::system::error_code &  error,
std::size_t  bytes_transferred 
)
static

Definition at line 107 of file http_curl.cc.

Here is the call graph for this function:

static size_t header_cb ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  data 
)
static

Definition at line 266 of file http_curl.cc.

Here is the call graph for this function:

int http_delete ( ConnInfo conn,
GlobalInfo g 
)

Definition at line 501 of file http_curl.cc.

int http_get ( ConnInfo conn,
GlobalInfo g 
)

Definition at line 482 of file http_curl.cc.

int http_head ( ConnInfo conn,
GlobalInfo g 
)

Definition at line 487 of file http_curl.cc.

int http_post ( ConnInfo conn,
GlobalInfo g 
)

Definition at line 497 of file http_curl.cc.

Here is the call graph for this function:

int http_put ( ConnInfo conn,
GlobalInfo g 
)

Definition at line 493 of file http_curl.cc.

Here is the call graph for this function:

static void mcode_or_die ( const char *  where,
CURLMcode  code 
)
static

Definition at line 54 of file http_curl.cc.

static int multi_timer_cb ( CURLM *  multi,
long  timeout_ms,
HttpClient client 
)
static

Definition at line 37 of file http_curl.cc.

Here is the call graph for this function:

ConnInfo* new_conn ( HttpConnection connection,
GlobalInfo g,
bool  header,
bool  short_timeout,
bool  reuse 
)

Definition at line 391 of file http_curl.cc.

Here is the call graph for this function:

static curl_socket_t open_socket ( void *  data,
curlsocktype  purpose,
struct curl_sockaddr *  address 
)
static

Definition at line 312 of file http_curl.cc.

Here is the call graph for this function:

static int prog_cb ( void *  p,
double  dltotal,
double  dlnow,
double  ult,
double  uln 
)
static

Definition at line 302 of file http_curl.cc.

static size_t read_cb ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  data 
)
static

Definition at line 275 of file http_curl.cc.

Here is the call graph for this function:

static void remsock ( SockInfo sock_info,
GlobalInfo g 
)
static

Definition at line 168 of file http_curl.cc.

static int send_perform ( ConnInfo conn,
GlobalInfo g 
)
static

Definition at line 341 of file http_curl.cc.

Here is the call graph for this function:

void set_header_options ( ConnInfo conn,
const char *  options 
)

Definition at line 445 of file http_curl.cc.

void set_post_string ( ConnInfo conn,
const char *  post,
uint32_t  len 
)

Definition at line 464 of file http_curl.cc.

void set_put_string ( ConnInfo conn,
const char *  put,
uint32_t  len 
)

Definition at line 473 of file http_curl.cc.

void set_ssl_options ( ConnInfo conn,
const char *  client_cert,
const char *  client_cert_type,
const char *  client_key,
const char *  ca_cert 
)

Definition at line 450 of file http_curl.cc.

void set_url ( ConnInfo conn,
const char *  url 
)

Definition at line 440 of file http_curl.cc.

static bool setsock ( SockInfo sock_info,
curl_socket_t  s,
CURL *  e,
int  act,
GlobalInfo g 
)
static

Definition at line 176 of file http_curl.cc.

Here is the call graph for this function:

static int sock_cb ( CURL *  e,
curl_socket_t  s,
int  what,
void *  cbp,
void *  sockp 
)
static

Definition at line 231 of file http_curl.cc.

Here is the call graph for this function:

bool timer_cb ( GlobalInfo g)

Definition at line 152 of file http_curl.cc.

Here is the call graph for this function:

static size_t write_cb ( void *  ptr,
size_t  size,
size_t  nmemb,
void *  data 
)
static

Definition at line 256 of file http_curl.cc.

Here is the call graph for this function:

Variable Documentation

const CurlErrorCategory curl_error_category

Definition at line 34 of file http_curl.cc.