DS3 C SDK  3.0.0
Provides access to the Spectra S3 API with C
Functions
ds3_net.c File Reference
#include <curl/curl.h>
#include "ds3_request.h"
#include "ds3.h"
#include "ds3_net.h"
#include "ds3_utils.h"
#include "ds3_string_multimap.h"
#include "ds3_string_multimap_impl.h"

Go to the source code of this file.

Functions

static void _init_curl (void)
 
static char * _net_get_verb (http_verb verb)
 
static char * _get_checksum_type_header (const ds3_checksum_type type)
 
char * escape_url (const char *url)
 
char * escape_url_extended (const char *url, const char **delimiters, uint32_t num_delimiters)
 
char * escape_url_object_name (const char *url)
 
char * escape_url_range_header (const char *url)
 
static unsigned char * _generate_signature_str (http_verb verb, char *resource_name, char *date, char *content_type, char *checksum_value, char *amz_headers)
 
static char * _generate_date_string (void)
 
static char * _net_compute_signature (const ds3_log *log, const ds3_creds *creds, http_verb verb, char *resource_name, char *date, char *content_type, char *checksum_value, char *amz_headers)
 
static void _hash_for_each (gpointer _key, gpointer _value, gpointer _user_data)
 
static char * _net_gen_query_params (GHashTable *query_params)
 
static struct curl_slist * _append_headers (struct curl_slist *header_list, GHashTable *headers_map)
 
static int ds3_curl_logger (CURL *handle, curl_infotype type, char *data, size_t size, void *userp)
 
static gint _gstring_sort (gconstpointer a, gconstpointer b)
 
static char * _canonicalize_amz_headers (GHashTable *headers)
 
static char * _canonicalized_resource (ds3_str *path, GHashTable *query_params)
 
static size_t _process_header_line (void *buffer, size_t size, size_t nmemb, void *user_data)
 
static size_t _process_response_body (void *buffer, size_t size, size_t nmemb, void *user_data)
 
ds3_errornet_process_request (const ds3_client *client, const ds3_request *_request, void *read_user_struct, size_t(*read_handler_func)(void *, size_t, size_t, void *), void *write_user_struct, size_t(*write_handler_func)(void *, size_t, size_t, void *), ds3_string_multimap **return_headers)
 
void net_cleanup (void)
 

Function Documentation

static struct curl_slist* _append_headers ( struct curl_slist *  header_list,
GHashTable *  headers_map 
)
static

Definition at line 203 of file ds3_net.c.

static char* _canonicalize_amz_headers ( GHashTable *  headers)
static

Definition at line 254 of file ds3_net.c.

static char* _canonicalized_resource ( ds3_str path,
GHashTable *  query_params 
)
static

Definition at line 288 of file ds3_net.c.

static char* _generate_date_string ( void  )
static

Definition at line 121 of file ds3_net.c.

static unsigned char* _generate_signature_str ( http_verb  verb,
char *  resource_name,
char *  date,
char *  content_type,
char *  checksum_value,
char *  amz_headers 
)
static

Definition at line 105 of file ds3_net.c.

static char* _get_checksum_type_header ( const ds3_checksum_type  type)
static

Definition at line 51 of file ds3_net.c.

static gint _gstring_sort ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 247 of file ds3_net.c.

static void _hash_for_each ( gpointer  _key,
gpointer  _value,
gpointer  _user_data 
)
static

Definition at line 160 of file ds3_net.c.

static void _init_curl ( void  )
static

Definition at line 28 of file ds3_net.c.

static char* _net_compute_signature ( const ds3_log log,
const ds3_creds creds,
http_verb  verb,
char *  resource_name,
char *  date,
char *  content_type,
char *  checksum_value,
char *  amz_headers 
)
static

Definition at line 130 of file ds3_net.c.

static char* _net_gen_query_params ( GHashTable *  query_params)
static

Definition at line 172 of file ds3_net.c.

static char* _net_get_verb ( http_verb  verb)
static

Definition at line 39 of file ds3_net.c.

static size_t _process_header_line ( void *  buffer,
size_t  size,
size_t  nmemb,
void *  user_data 
)
static

Definition at line 296 of file ds3_net.c.

static size_t _process_response_body ( void *  buffer,
size_t  size,
size_t  nmemb,
void *  user_data 
)
static

Definition at line 363 of file ds3_net.c.

static int ds3_curl_logger ( CURL *  handle,
curl_infotype  type,
char *  data,
size_t  size,
void *  userp 
)
static

Definition at line 217 of file ds3_net.c.

char* escape_url ( const char *  url)

Definition at line 67 of file ds3_net.c.

char* escape_url_extended ( const char *  url,
const char **  delimiters,
uint32_t  num_delimiters 
)

Definition at line 75 of file ds3_net.c.

char* escape_url_object_name ( const char *  url)

Definition at line 94 of file ds3_net.c.

char* escape_url_range_header ( const char *  url)

Definition at line 100 of file ds3_net.c.

void net_cleanup ( void  )

Definition at line 584 of file ds3_net.c.

ds3_error* net_process_request ( const ds3_client client,
const ds3_request _request,
void *  read_user_struct,
size_t(*)(void *, size_t, size_t, void *)  read_handler_func,
void *  write_user_struct,
size_t(*)(void *, size_t, size_t, void *)  write_handler_func,
ds3_string_multimap **  return_headers 
)

Definition at line 374 of file ds3_net.c.