|
YAZ
4.2.57
|
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_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) |
| 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) |
Implements HTTP decoding.
Definition in file http.c.
|
static |
Definition at line 25 of file http.c.
References odr::buf, odr::error, Z_HTTP_Header::next, odr_malloc(), OHTTP, odr::size, yaz_isdigit, yaz_islower, and yaz_isupper.
Referenced by yaz_decode_http_request(), and yaz_decode_http_response().
|
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 | ||
| ) |
Definition at line 487 of file http.c.
References odr::buf, Z_HTTP_Request::content_buf, Z_HTTP_Request::content_len, decode_headers_content(), odr::error, Z_HTTP_Request::headers, Z_HTTP_Request::method, odr_malloc(), OHTTP, Z_HTTP_Request::path, odr::size, and Z_HTTP_Request::version.
Referenced by z_GDU().
| int yaz_decode_http_response | ( | ODR | o, |
| Z_HTTP_Response ** | hr_p | ||
| ) |
Definition at line 453 of file http.c.
References odr::buf, Z_HTTP_Response::code, Z_HTTP_Response::content_buf, Z_HTTP_Response::content_len, decode_headers_content(), odr::error, Z_HTTP_Response::headers, odr_malloc(), OHTTP, and Z_HTTP_Response::version.
Referenced by z_GDU().
| int yaz_encode_http_request | ( | ODR | o, |
| Z_HTTP_Request * | hr | ||
| ) |
Definition at line 601 of file http.c.
References odr::buf, Z_HTTP_Request::content_buf, Z_HTTP_Request::content_len, odr::direction, dump_http_package(), Z_HTTP_Request::headers, Z_HTTP_Request::method, Z_HTTP_Header::name, Z_HTTP_Header::next, ODR_PRINT, odr_printf(), odr_write2(), Z_HTTP_Request::path, odr::top, Z_HTTP_Header::value, Z_HTTP_Request::version, and z_HTTP_header_lookup().
Referenced by z_GDU().
| int yaz_encode_http_response | ( | ODR | o, |
| Z_HTTP_Response * | hr | ||
| ) |
Definition at line 566 of file http.c.
References odr::buf, Z_HTTP_Response::code, Z_HTTP_Response::content_buf, Z_HTTP_Response::content_len, odr::direction, dump_http_package(), Z_HTTP_Response::headers, Z_HTTP_Header::name, Z_HTTP_Header::next, ODR_PRINT, odr_printf(), odr_write(), odr_write2(), odr::top, Z_HTTP_Header::value, Z_HTTP_Response::version, yaz_matchstr(), and z_HTTP_errmsg().
Referenced by z_GDU().
Definition at line 236 of file http.c.
References Z_HTTP_Request::content_buf, Z_HTTP_Request::content_len, Z_HTTP_Request::headers, Z_GDU::HTTP_Request, Z_HTTP_Request::method, odr_malloc(), Z_HTTP_Request::path, Z_GDU::u, Z_HTTP_Request::version, Z_GDU::which, YAZ_VERSION, Z_GDU_HTTP_Request, and z_HTTP_header_add().
Referenced by z_get_HTTP_Request_host_path(), and z_get_HTTP_Request_uri().
Definition at line 255 of file http.c.
References Z_HTTP_Request::headers, Z_GDU::HTTP_Request, odr_malloc(), odr_strdup(), Z_HTTP_Request::path, Z_GDU::u, z_get_HTTP_Request(), and z_HTTP_header_add().
Definition at line 288 of file http.c.
References Z_HTTP_Request::headers, Z_GDU::HTTP_Request, odr_malloc(), Z_HTTP_Request::path, Z_GDU::u, z_get_HTTP_Request(), and z_HTTP_header_add().
Referenced by send_HTTP_redirect(), send_srw(), and yaz_url_exec().
Definition at line 331 of file http.c.
References Z_HTTP_Response::code, Z_HTTP_Response::content_buf, Z_HTTP_Response::content_len, Z_HTTP_Response::headers, Z_GDU::HTTP_Response, odr_malloc(), Z_GDU::u, Z_HTTP_Response::version, Z_GDU::which, YAZ_VERSION, Z_GDU_HTTP_Response, z_HTTP_errmsg(), and z_HTTP_header_add().
Referenced by ir_read(), and process_http_request().
| 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 | ||
| ) |
Definition at line 198 of file http.c.
References Z_HTTP_Header::next, odr_malloc(), and odr_strdup().
Referenced by process_http_request(), send_HTTP_redirect(), yaz_sru_soap_encode(), yaz_url_exec(), z_get_HTTP_Request(), z_get_HTTP_Request_host_path(), z_get_HTTP_Request_uri(), z_get_HTTP_Response(), and z_HTTP_header_add_content_type().
| void z_HTTP_header_add_basic_auth | ( | ODR | o, |
| Z_HTTP_Header ** | hp, | ||
| const char * | username, | ||
| const char * | password | ||
| ) |
Definition at line 177 of file http.c.
References odr_malloc(), yaz_base64encode(), and z_HTTP_header_set().
Referenced by send_HTTP_redirect(), yaz_solr_encode_request(), yaz_sru_get_encode(), yaz_sru_post_encode(), yaz_sru_soap_encode(), and yaz_url_exec().
| void z_HTTP_header_add_content_type | ( | ODR | o, |
| Z_HTTP_Header ** | hp, | ||
| const char * | content_type, | ||
| const char * | charset | ||
| ) |
Definition at line 156 of file http.c.
References odr_malloc(), and z_HTTP_header_add().
Referenced by yaz_solr_encode_request(), yaz_sru_get_encode(), yaz_sru_post_encode(), and yaz_sru_soap_encode().
| const char* z_HTTP_header_lookup | ( | const Z_HTTP_Header * | hp, |
| const char * | n | ||
| ) |
Definition at line 227 of file http.c.
References Z_HTTP_Header::name, Z_HTTP_Header::next, Z_HTTP_Header::value, and yaz_matchstr().
Referenced by handle_http(), process_http_request(), yaz_encode_http_request(), yaz_sru_decode(), yaz_srw_check_content_type(), yaz_srw_decode(), yaz_srw_decodeauth(), and yaz_url_exec().
| 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().
1.8.1.2