|
YAZ 5.38.1
|
Header for the Z_GDU (HTTP or Z39.50 package). More...
#include <yaz/z-core.h>Go to the source code of this file.
Data Structures | |
| struct | Z_HTTP_Header |
| struct | Z_HTTP_Request |
| struct | Z_HTTP_Response |
| struct | Z_GDU |
Macros | |
| #define | Z_GDU_Z3950 1 |
| #define | Z_GDU_HTTP_Request 2 |
| #define | Z_GDU_HTTP_Response 3 |
Typedefs | |
| typedef struct Z_HTTP_Header | Z_HTTP_Header |
Functions | |
| int | z_GDU (ODR o, Z_GDU **p, int opt, const char *name) |
| 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) |
| 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) |
| const char * | z_HTTP_header_lookup (const Z_HTTP_Header *hp, const char *n) |
| const char * | z_HTTP_header_remove (Z_HTTP_Header **hp, const char *n) |
| const char * | z_HTTP_errmsg (int code) |
| Z_GDU * | z_get_HTTP_Response (ODR o, int code) |
| Z_GDU * | z_get_HTTP_Response_details (ODR o, int code, const char *details) |
| Z_GDU * | z_get_HTTP_Response_server (ODR o, int code, const char *details, const char *server, const char *server_url) |
| 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) |
| int | yaz_decode_http_response_first (const char *buf, int sz, int *code, const char **version, int *version_len, const char **msg, int *msg_len) |
| 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_response (ODR o, Z_HTTP_Response *hr) |
| int | yaz_encode_http_request (ODR o, Z_HTTP_Request *hr) |
| const char * | yaz_check_location (ODR odr, const char *uri, const char *location, int *host_change) |
| #define Z_GDU_HTTP_Request 2 |
Definition at line 66 of file zgdu.h.
Referenced by process_gdu_request(), z_GDU(), and z_get_HTTP_Request().
| #define Z_GDU_HTTP_Response 3 |
Definition at line 67 of file zgdu.h.
Referenced by do_read(), yaz_url_exec(), z_GDU(), and z_get_HTTP_Response_server().
| #define Z_GDU_Z3950 1 |
Definition at line 65 of file zgdu.h.
Referenced by do_read(), process_gdu_request(), process_z_response(), and z_GDU().
| const char * yaz_check_location | ( | ODR | odr, |
| const char * | uri, | ||
| const char * | location, | ||
| int * | host_change ) |
Definition at line 664 of file http.c.
References cs_get_host_args(), odr_malloc(), and yaz_check_location().
Referenced by handle_http(), yaz_check_location(), and yaz_url_exec().
| int yaz_decode_http_request | ( | ODR | o, |
| Z_HTTP_Request ** | hr_p ) |
Definition at line 508 of file http.c.
References Odr_private::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(), odr_strdupn(), OHTTP, odr::op, Z_HTTP_Request::path, Odr_private::size, Z_HTTP_Request::version, and yaz_decode_http_request().
Referenced by yaz_decode_http_request(), and z_GDU().
| int yaz_decode_http_response | ( | ODR | o, |
| Z_HTTP_Response ** | hr_p ) |
Definition at line 486 of file http.c.
References Odr_private::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(), odr_strdupn(), OHTTP, odr::op, Odr_private::size, Z_HTTP_Response::version, yaz_decode_http_response(), and yaz_decode_http_response_first().
Referenced by yaz_decode_http_response(), and z_GDU().
| int yaz_decode_http_response_first | ( | const char * | buf, |
| int | sz, | ||
| int * | code, | ||
| const char ** | version, | ||
| int * | version_len, | ||
| const char ** | msg, | ||
| int * | msg_len ) |
Definition at line 437 of file http.c.
References yaz_decode_http_response_first().
Referenced by tcpip_rcvconnect(), yaz_decode_http_response(), and yaz_decode_http_response_first().
| int yaz_encode_http_request | ( | ODR | o, |
| Z_HTTP_Request * | hr ) |
Definition at line 619 of file http.c.
References Odr_private::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_write(), odr::op, Z_HTTP_Request::path, Odr_private::top, Z_HTTP_Header::value, Z_HTTP_Request::version, yaz_encode_http_request(), yaz_snprintf(), yaz_strcasecmp(), and z_HTTP_header_lookup().
Referenced by yaz_encode_http_request(), and z_GDU().
| int yaz_encode_http_response | ( | ODR | o, |
| Z_HTTP_Response * | hr ) |
Definition at line 583 of file http.c.
References Odr_private::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::op, Odr_private::top, Z_HTTP_Header::value, Z_HTTP_Response::version, yaz_encode_http_response(), yaz_snprintf(), yaz_strcasecmp(), and z_HTTP_errmsg().
Referenced by yaz_encode_http_response(), and z_GDU().
Definition at line 17 of file zgdu.c.
References Odr_private::buf, odr::direction, ODR_DECODE, odr_malloc(), odr::op, Odr_private::size, yaz_decode_http_request(), yaz_decode_http_response(), yaz_encode_http_request(), yaz_encode_http_response(), z_APDU(), z_GDU(), Z_GDU_HTTP_Request, Z_GDU_HTTP_Response, and Z_GDU_Z3950.
Referenced by do_read(), ir_read(), process_gdu_response(), yaz_url_exec(), z_GDU(), and ZOOM_send_GDU().
Definition at line 205 of file http.c.
References Z_HTTP_Request::content_buf, Z_HTTP_Request::content_len, Z_HTTP_Request::headers, 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, z_get_HTTP_Request(), and z_HTTP_header_add().
Referenced by z_get_HTTP_Request(), z_get_HTTP_Request_host_path(), and z_get_HTTP_Request_uri().
Definition at line 224 of file http.c.
References odr_strdup(), odr_strdupn(), Z_GDU::u, z_get_HTTP_Request(), z_get_HTTP_Request_host_path(), and z_HTTP_header_add().
Referenced by z_get_HTTP_Request_host_path().
Definition at line 254 of file http.c.
References odr_malloc(), odr_strdupn(), Z_GDU::u, z_get_HTTP_Request(), z_get_HTTP_Request_uri(), and z_HTTP_header_add().
Referenced by send_HTTP_redirect(), send_srw(), yaz_url_exec(), and z_get_HTTP_Request_uri().
Definition at line 349 of file http.c.
References z_get_HTTP_Response(), and z_get_HTTP_Response_details().
Referenced by ir_read(), process_http_request(), and z_get_HTTP_Response().
Definition at line 343 of file http.c.
References YAZ_VERSION, z_get_HTTP_Response_details(), and z_get_HTTP_Response_server().
Referenced by z_get_HTTP_Response(), and z_get_HTTP_Response_details().
| Z_GDU * z_get_HTTP_Response_server | ( | ODR | o, |
| int | code, | ||
| const char * | details, | ||
| const char * | server, | ||
| const char * | server_url ) |
Definition at line 294 of file http.c.
References Z_HTTP_Response::code, Z_HTTP_Response::content_buf, Z_HTTP_Response::content_len, Z_HTTP_Response::headers, odr_malloc(), Z_GDU::u, Z_HTTP_Response::version, Z_GDU::which, yaz_snprintf(), Z_GDU_HTTP_Response, z_get_HTTP_Response_server(), z_HTTP_errmsg(), and z_HTTP_header_add().
Referenced by z_get_HTTP_Response_details(), and z_get_HTTP_Response_server().
| const char * z_HTTP_errmsg | ( | int | code | ) |
Definition at line 354 of file http.c.
References z_HTTP_errmsg().
Referenced by yaz_encode_http_response(), z_get_HTTP_Response_server(), z_HTTP_errmsg(), 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 152 of file http.c.
References Z_HTTP_Header::next, odr_malloc(), odr_strdup(), and z_HTTP_header_add().
Referenced by process_http_request(), send_HTTP_redirect(), yaz_cookies_request(), 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_server(), z_HTTP_header_add(), 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 135 of file http.c.
References nmem_printf(), odr_getmem, odr_malloc(), yaz_base64encode(), z_HTTP_header_add_basic_auth(), 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(), yaz_url_exec(), and z_HTTP_header_add_basic_auth().
| void z_HTTP_header_add_content_type | ( | ODR | o, |
| Z_HTTP_Header ** | hp, | ||
| const char * | content_type, | ||
| const char * | charset ) |
Definition at line 115 of file http.c.
References nmem_printf(), odr_getmem, z_HTTP_header_add(), and z_HTTP_header_add_content_type().
Referenced by yaz_sru_get_encode(), yaz_sru_post_encode(), yaz_sru_soap_encode(), and z_HTTP_header_add_content_type().
| const char * z_HTTP_header_lookup | ( | const Z_HTTP_Header * | hp, |
| const char * | n ) |
Definition at line 196 of file http.c.
References Z_HTTP_Header::name, Z_HTTP_Header::next, Z_HTTP_Header::value, yaz_strcasecmp(), and z_HTTP_header_lookup().
Referenced by handle_http(), process_http_request(), rdf_lookup_node(), srw_bend_init(), yaz_encode_http_request(), yaz_sru_decode(), yaz_srw_check_content_type(), yaz_srw_decode(), yaz_srw_decodeauth(), yaz_url_exec(), and z_HTTP_header_lookup().
| const char * z_HTTP_header_remove | ( | Z_HTTP_Header ** | hp, |
| const char * | n ) |
Definition at line 181 of file http.c.
References Z_HTTP_Header::next, yaz_strcasecmp(), and z_HTTP_header_remove().
Referenced by z_HTTP_header_remove().
| void z_HTTP_header_set | ( | ODR | o, |
| Z_HTTP_Header ** | hp, | ||
| const char * | n, | ||
| const char * | v ) |
Definition at line 163 of file http.c.
References Z_HTTP_Header::next, odr_malloc(), odr_strdup(), yaz_strcasecmp(), and z_HTTP_header_set().
Referenced by yaz_url_exec(), z_HTTP_header_add_basic_auth(), and z_HTTP_header_set().