DS3 C SDK  4.1.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_net.h"
#include "ds3_utils.h"
#include "ds3_string_multimap_impl.h"
#include "ds3_connection.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

◆ _append_headers()

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

Definition at line 204 of file ds3_net.c.

◆ _canonicalize_amz_headers()

static char* _canonicalize_amz_headers ( GHashTable *  headers)
static

Definition at line 255 of file ds3_net.c.

◆ _canonicalized_resource()

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

Definition at line 289 of file ds3_net.c.

◆ _generate_date_string()

static char* _generate_date_string ( void  )
static

Definition at line 121 of file ds3_net.c.

◆ _generate_signature_str()

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.

◆ _get_checksum_type_header()

static char* _get_checksum_type_header ( const ds3_checksum_type  type)
static

Definition at line 51 of file ds3_net.c.

◆ _gstring_sort()

static gint _gstring_sort ( gconstpointer  a,
gconstpointer  b 
)
static

Definition at line 248 of file ds3_net.c.

◆ _hash_for_each()

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

Definition at line 160 of file ds3_net.c.

◆ _init_curl()

static void _init_curl ( void  )
static

Definition at line 28 of file ds3_net.c.

◆ _net_compute_signature()

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.

◆ _net_gen_query_params()

static char* _net_gen_query_params ( GHashTable *  query_params)
static

Definition at line 172 of file ds3_net.c.

◆ _net_get_verb()

static char* _net_get_verb ( http_verb  verb)
static

Definition at line 39 of file ds3_net.c.

◆ _process_header_line()

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

Definition at line 297 of file ds3_net.c.

◆ _process_response_body()

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

Definition at line 364 of file ds3_net.c.

◆ ds3_curl_logger()

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

Definition at line 218 of file ds3_net.c.

◆ escape_url()

char* escape_url ( const char *  url)

Definition at line 67 of file ds3_net.c.

◆ escape_url_extended()

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

Definition at line 75 of file ds3_net.c.

◆ escape_url_object_name()

char* escape_url_object_name ( const char *  url)

Definition at line 94 of file ds3_net.c.

◆ escape_url_range_header()

char* escape_url_range_header ( const char *  url)

Definition at line 100 of file ds3_net.c.

◆ net_cleanup()

void net_cleanup ( void  )

Definition at line 591 of file ds3_net.c.

◆ net_process_request()

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 375 of file ds3_net.c.