OpenSDN source code
|
#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>
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) |
ConnInfo * | new_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 |
#define MSG_OUT stdout /* Send info to stdout, change to stderr if you want */ |
Definition at line 30 of file http_curl.cc.
typedef boost::intrusive_ptr<HttpClientSession> TcpSessionPtr |
Definition at line 105 of file http_curl.cc.
|
static |
|
static |
|
static |
int curl_init | ( | HttpClient * | client | ) |
void del_conn | ( | HttpConnection * | connection, |
GlobalInfo * | g | ||
) |
void del_curl_handle | ( | ConnInfo * | curl_handle, |
GlobalInfo * | g | ||
) |
Definition at line 378 of file http_curl.cc.
|
static |
|
static |
|
static |
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 | ||
) |
int http_put | ( | ConnInfo * | conn, |
GlobalInfo * | g | ||
) |
|
static |
Definition at line 54 of file http_curl.cc.
|
static |
ConnInfo* new_conn | ( | HttpConnection * | connection, |
GlobalInfo * | g, | ||
bool | header, | ||
bool | short_timeout, | ||
bool | reuse | ||
) |
|
static |
|
static |
Definition at line 302 of file http_curl.cc.
|
static |
|
static |
Definition at line 168 of file http_curl.cc.
|
static |
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 |
|
static |
bool timer_cb | ( | GlobalInfo * | g | ) |
|
static |
const CurlErrorCategory curl_error_category |
Definition at line 34 of file http_curl.cc.