http-client.h revision 56d1345c43bbd28c36b7faa85e4163bd9e874290
#ifndef HTTP_CLIENT_H
#define HTTP_CLIENT_H
#include "http-response-parser.h"
struct http_response;
struct http_client;
struct http_client_request;
enum http_client_request_error {
};
enum http_request_state {
};
extern const char *http_request_state_names[];
struct http_client_settings {
const char *dns_client_socket_path;
const char *ssl_crypto_device;
bool ssl_allow_invalid_cert;
const char *rawlog_dir;
unsigned int max_idle_time_msecs;
/* maximum number of parallel connections per peer (default = 1) */
unsigned int max_parallel_connections;
/* maximum number of pipelined requests per connection (default = 1) */
unsigned int max_pipelined_requests;
/* maximum number of redirects for a request
(default = 0; redirects refused)
*/
unsigned int max_redirects;
/* maximum number of attempts for a request */
unsigned int max_attempts;
bool debug;
};
typedef void
void *context);
struct http_client_request *
CALLBACK_TYPECHECK(callback, void (*)( \
unsigned int port);
bool ssl);
enum http_request_state
/* Call the specified callback when HTTP request is destroyed. */
void (*callback)(void *),
void *context);
/* submits request and blocks until provided payload is sent. Multiple calls
are allowed; payload transmission is ended with
http_client_request_finish_payload(). */
/* blocks until all currently submitted requests are handled */
#endif