YAZ  4.2.57
Functions
http.c File Reference

Implements HTTP decoding. More...

#include <yaz/odr.h>
#include <yaz/yaz-version.h>
#include <yaz/yaz-iconv.h>
#include <yaz/matchstr.h>
#include <yaz/zgdu.h>
#include <yaz/base64.h>

Go to the source code of this file.

Functions

static int decode_headers_content (ODR o, int off, Z_HTTP_Header **headers, char **content_buf, int *content_len)
void z_HTTP_header_add_content_type (ODR o, Z_HTTP_Header **hp, const char *content_type, const char *charset)
void z_HTTP_header_add_basic_auth (ODR o, Z_HTTP_Header **hp, const char *username, const char *password)
void z_HTTP_header_add (ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
void z_HTTP_header_set (ODR o, Z_HTTP_Header **hp, const char *n, const char *v)
const char * z_HTTP_header_lookup (const Z_HTTP_Header *hp, const char *n)
Z_GDUz_get_HTTP_Request (ODR o)
Z_GDUz_get_HTTP_Request_host_path (ODR odr, const char *host, const char *path)
Z_GDUz_get_HTTP_Request_uri (ODR odr, const char *uri, const char *args, int use_full_uri)
Z_GDUz_get_HTTP_Response (ODR o, int code)
const char * z_HTTP_errmsg (int code)
int yaz_decode_http_response (ODR o, Z_HTTP_Response **hr_p)
int yaz_decode_http_request (ODR o, Z_HTTP_Request **hr_p)
static void dump_http_package (ODR o, const char *buf, size_t len)
int yaz_encode_http_response (ODR o, Z_HTTP_Response *hr)
int yaz_encode_http_request (ODR o, Z_HTTP_Request *hr)

Detailed Description

Implements HTTP decoding.

Definition in file http.c.

Function Documentation

static int decode_headers_content ( ODR  o,
int  off,
Z_HTTP_Header **  headers,
char **  content_buf,
int *  content_len 
)
static
static void dump_http_package ( ODR  o,
const char *  buf,
size_t  len 
)
static

Definition at line 541 of file http.c.

References odr_printf().

Referenced by yaz_encode_http_request(), and yaz_encode_http_response().

int yaz_decode_http_request ( ODR  o,
Z_HTTP_Request **  hr_p 
)
int yaz_decode_http_response ( ODR  o,
Z_HTTP_Response **  hr_p 
)
int yaz_encode_http_request ( ODR  o,
Z_HTTP_Request hr 
)
int yaz_encode_http_response ( ODR  o,
Z_HTTP_Response hr 
)
Z_GDU* z_get_HTTP_Request ( ODR  o)
Z_GDU* z_get_HTTP_Request_host_path ( ODR  odr,
const char *  host,
const char *  path 
)
Z_GDU* z_get_HTTP_Request_uri ( ODR  odr,
const char *  uri,
const char *  args,
int  use_full_uri 
)
Z_GDU* z_get_HTTP_Response ( ODR  o,
int  code 
)
const char* z_HTTP_errmsg ( int  code)

Definition at line 370 of file http.c.

Referenced by yaz_encode_http_response(), z_get_HTTP_Response(), and ZOOM_connection_error_x().

void z_HTTP_header_add ( ODR  o,
Z_HTTP_Header **  hp,
const char *  n,
const char *  v 
)
void z_HTTP_header_add_basic_auth ( ODR  o,
Z_HTTP_Header **  hp,
const char *  username,
const char *  password 
)
void z_HTTP_header_add_content_type ( ODR  o,
Z_HTTP_Header **  hp,
const char *  content_type,
const char *  charset 
)
const char* z_HTTP_header_lookup ( const Z_HTTP_Header hp,
const char *  n 
)
void z_HTTP_header_set ( ODR  o,
Z_HTTP_Header **  hp,
const char *  n,
const char *  v 
)

Definition at line 209 of file http.c.

References Z_HTTP_Header::next, odr_malloc(), and odr_strdup().

Referenced by yaz_url_exec(), and z_HTTP_header_add_basic_auth().