YAZ
5.34.0
|
Implements ZOOM C interface. More...
#include <assert.h>
#include <string.h>
#include <errno.h>
#include "zoom-p.h"
#include <yaz/yaz-util.h>
#include <yaz/xmalloc.h>
#include <yaz/otherinfo.h>
#include <yaz/log.h>
#include <yaz/diagbib1.h>
#include <yaz/charneg.h>
#include <yaz/query-charset.h>
#include <yaz/snprintf.h>
#include <yaz/facet.h>
#include <yaz/shptr.h>
Go to the source code of this file.
Variables | |
static int | log_api0 = 0 |
static int | log_details0 = 0 |
static int | g_resultsets = 0 |
static YAZ_MUTEX | g_resultset_mutex = 0 |
Implements ZOOM C interface.
Definition in file zoom-c.c.
|
static |
Definition at line 103 of file zoom-c.c.
References ZOOM_connection_p::error, ZOOM_connection_remove_events(), ZOOM_ERROR_CONNECT, ZOOM_ERROR_CONNECTION_LOST, ZOOM_ERROR_DECODE, ZOOM_ERROR_INIT, ZOOM_ERROR_INTERNAL, ZOOM_ERROR_MEMORY, ZOOM_ERROR_NONE, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, and ZOOM_set_error().
Referenced by ZOOM_connection_add_task().
|
static |
Definition at line 1069 of file zoom-c.c.
References do_connect_host(), and ZOOM_connection_p::host_port.
Referenced by ZOOM_connection_exec_task().
|
static |
Definition at line 1074 of file zoom-c.c.
References ZOOM_connection_p::cs, cs_close, cs_connect, cs_create_host2(), CS_FLAGS_DNS_NO_BLOCK, CS_WANT_READ, CS_WANT_WRITE, get_cert(), comstack::io_pending, ZOOM_connection_p::location, mask, ZOOM_connection_p::proto, PROTO_HTTP, PROTO_Z3950, comstack::protocol, ZOOM_connection_p::proxy, ZOOM_connection_p::proxy_mode, send_HTTP_redirect(), ZOOM_connection_p::state, STATE_CONNECTING, STATE_ESTABLISHED, STATE_IDLE, ZOOM_connection_p::tasks, ZOOM_connection_p::tproxy, ZOOM_task_p::which, zoom_complete, ZOOM_connection_close(), ZOOM_connection_exec_task(), ZOOM_connection_put_event(), ZOOM_connection_remove_task(), ZOOM_connection_set_mask(), ZOOM_connection_Z3950_send_init(), ZOOM_ERROR_CONNECT, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, ZOOM_EVENT_CONNECT, ZOOM_Event_create(), zoom_pending, ZOOM_SELECT_EXCEPT, ZOOM_SELECT_READ, ZOOM_SELECT_WRITE, ZOOM_set_error(), and ZOOM_TASK_CONNECT.
Referenced by do_connect(), and handle_http().
|
static |
Definition at line 1644 of file zoom-c.c.
References ZOOM_connection_p::buf_in, ZOOM_connection_p::cs, cs_get, cs_more, handle_http(), ZOOM_connection_p::host_port, Z_GDU::HTTP_Response, ZOOM_connection_p::len_in, ZOOM_connection_p::log_api, ZOOM_connection_p::log_details, odr_dumpBER(), odr_getelement(), odr_geterrorx(), ZOOM_connection_p::odr_in, odr_offset(), ZOOM_connection_p::odr_print, odr_reset(), ZOOM_connection_p::odr_save, odr_setbuf(), Z_GDU::u, Z_GDU::which, yaz_log(), yaz_log_file(), yaz_snprintf(), Z_GDU::z3950, z_GDU(), Z_GDU_HTTP_Response, Z_GDU_Z3950, ZOOM_connection_close(), ZOOM_connection_put_event(), ZOOM_ERROR_CONNECTION_LOST, ZOOM_ERROR_DECODE, ZOOM_Event_create(), ZOOM_EVENT_RECV_APDU, ZOOM_EVENT_RECV_DATA, ZOOM_handle_Z3950_apdu(), ZOOM_set_error(), and ZOOM_test_reconnect().
Referenced by ZOOM_connection_do_io().
|
static |
Definition at line 1720 of file zoom-c.c.
References ZOOM_connection_p::cs, cs_put, CS_WANT_READ, CS_WANT_WRITE, ZOOM_connection_p::host_port, comstack::io_pending, ZOOM_connection_p::log_details, mask, ZOOM_connection_p::mask, ZOOM_connection_p::state, STATE_CONNECTING, yaz_log(), zoom_complete, ZOOM_connection_close(), ZOOM_connection_put_event(), ZOOM_connection_set_mask(), ZOOM_ERROR_CONNECT, ZOOM_ERROR_CONNECTION_LOST, ZOOM_Event_create(), ZOOM_EVENT_SEND_DATA, zoom_pending, ZOOM_SELECT_EXCEPT, ZOOM_SELECT_READ, ZOOM_SELECT_WRITE, ZOOM_set_error(), and ZOOM_test_reconnect().
Referenced by ZOOM_send_buf().
|
static |
Definition at line 1053 of file zoom-c.c.
References ZOOM_connection_p::cs, cs_get_peer_certificate_x509(), xfree, and ZOOM_connection_option_setl().
Referenced by do_connect_host(), and ZOOM_connection_do_io().
|
static |
Definition at line 345 of file zoom-c.c.
References yaz_matchstr(), zoom_sru_error, zoom_sru_get, zoom_sru_post, zoom_sru_soap, and zoom_sru_solr.
Referenced by ZOOM_connection_connect().
|
static |
Definition at line 1553 of file zoom-c.c.
References Z_HTTP_Response::code, ZOOM_connection_p::cookies, do_connect_host(), Z_HTTP_Response::headers, ZOOM_connection_p::host_port, ZOOM_connection_p::location, ZOOM_connection_p::log_details, ZOOM_connection_p::no_redirects, ZOOM_connection_p::odr_in, ZOOM_connection_p::reconnect_ok, ZOOM_task_p::running, ZOOM_connection_p::sru_mode, ZOOM_connection_p::tasks, Z_HTTP_Response::version, xfree, xstrdup, yaz_check_location(), yaz_cookies_response(), yaz_log(), YLOG_LOG, z_HTTP_header_lookup(), zoom_complete, ZOOM_connection_close(), ZOOM_connection_insert_task(), ZOOM_connection_remove_task(), ZOOM_connection_set_mask(), ZOOM_ERROR_DECODE, ZOOM_handle_sru(), ZOOM_set_error(), ZOOM_set_HTTP_error(), zoom_sru_get, and ZOOM_TASK_CONNECT.
Referenced by do_read().
|
static |
Definition at line 40 of file zoom-c.c.
References log_api0, log_details0, log_level_initialized, and yaz_log_module_level().
Referenced by ZOOM_connection_connect(), ZOOM_connection_create(), and ZOOM_resultset_create().
|
static |
|
static |
Definition at line 868 of file zoom-c.c.
References ZOOM_resultset_p::connection, log_details0, ZOOM_resultset_p::mc_key, ZOOM_resultset_p::mutex, ZOOM_resultset_p::odr, odr_destroy(), ZOOM_resultset_p::options, ZOOM_resultset_p::query, ZOOM_resultset_p::record_wrbuf, ZOOM_resultset_p::refcount, resultset_use(), wrbuf_destroy(), xfree, yaz_log(), yaz_mutex_destroy(), yaz_mutex_enter(), yaz_mutex_leave(), YAZ_SHPTR_DEC, ZOOM_options_destroy(), ZOOM_query_destroy(), ZOOM_resultset_cache_reset(), and ZOOM_resultset_release().
Referenced by ZOOM_connection_remove_task(), and ZOOM_resultset_destroy().
|
static |
Definition at line 667 of file zoom-c.c.
References g_resultset_mutex, g_resultsets, yaz_mutex_create(), yaz_mutex_enter(), and yaz_mutex_leave().
Referenced by resultset_destroy(), resultsets_count(), and ZOOM_resultset_create().
int resultsets_count | ( | void | ) |
Definition at line 678 of file zoom-c.c.
References resultset_use().
|
static |
Definition at line 1507 of file zoom-c.c.
References ZOOM_connection_p::cookies, Z_HTTP_Request::headers, Z_GDU::HTTP_Request, ZOOM_connection_p::location, Z_HTTP_Request::method, ZOOM_connection_p::odr_out, odr_strdup(), ZOOM_connection_p::password, ZOOM_connection_p::proxy, Z_GDU::u, ZOOM_connection_p::user, xfree, yaz_cookies_request(), z_get_HTTP_Request_uri(), z_HTTP_header_add(), z_HTTP_header_add_basic_auth(), and ZOOM_send_GDU().
Referenced by do_connect_host(), and ZOOM_connection_do_io().
|
static |
Definition at line 1244 of file zoom-c.c.
References ZOOM_connection_p::buf_out, ZOOM_package_p::buf_out, ZOOM_connection_p::len_out, ZOOM_package_p::len_out, ZOOM_connection_p::log_details, ZOOM_task_p::package, ZOOM_connection_p::tasks, ZOOM_task_p::u, ZOOM_task_p::which, yaz_log(), zoom_complete, ZOOM_connection_put_event(), ZOOM_Event_create(), ZOOM_EVENT_SEND_APDU, ZOOM_send_buf(), and ZOOM_TASK_PACKAGE.
Referenced by ZOOM_connection_exec_task().
ZOOM_API | ( | int | ) |
Definition at line 166 of file zoom-c.c.
References ZOOM_connection_p::tasks.
ZOOM_API | ( | void | ) |
Definition at line 306 of file zoom-c.c.
References odr_createmem(), odr_destroy(), ODR_PRINT, ZOOM_connection_p::odr_save, odr_set_stream(), and odr_wrbuf_write().
ZOOM_task ZOOM_connection_add_task | ( | ZOOM_connection | c, |
int | which | ||
) |
Definition at line 153 of file zoom-c.c.
References clear_error(), ZOOM_task_p::next, ZOOM_connection_p::tasks, and xmalloc.
Referenced by ZOOM_connection_connect(), ZOOM_connection_scan1(), ZOOM_connection_search(), ZOOM_package_send(), ZOOM_resultset_retrieve(), and ZOOM_resultset_sort1().
ZOOM_connection_addinfo | ( | ZOOM_connection | c | ) |
Definition at line 1860 of file zoom-c.c.
References ZOOM_connection_error().
ZOOM_connection_connect | ( | ZOOM_connection | c, |
const char * | host, | ||
int | portnum | ||
) |
Definition at line 361 of file zoom-c.c.
References get_sru_mode_from_string(), initlog(), odr_createmem(), odr_destroy(), ODR_PRINT, odr_setprint(), odr_setprint_noclose(), wrbuf_alloc(), wrbuf_cstr(), wrbuf_destroy(), wrbuf_printf(), xfree, xmalloc, xstrdup, yaz_cookies_create(), yaz_cookies_destroy(), yaz_log(), yaz_log_file(), ZOOM_connection_add_task(), ZOOM_connection_option_set(), ZOOM_connection_remove_tasks(), ZOOM_ERROR_INTERNAL, ZOOM_ERROR_NONE, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, ZOOM_event(), ZOOM_memcached_configure(), ZOOM_options_get(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_options_set(), ZOOM_set_error(), zoom_sru_error, and ZOOM_TASK_CONNECT.
Referenced by ZOOM_connection_new().
ZOOM_connection_create | ( | ZOOM_options | options | ) |
Definition at line 237 of file zoom-c.c.
References ZOOM_connection_p::addinfo, ZOOM_connection_p::async, ZOOM_connection_p::buf_in, ZOOM_connection_p::buf_out, ZOOM_connection_p::charset, ZOOM_connection_p::client_IP, ZOOM_connection_p::cookie_in, ZOOM_connection_p::cookie_out, ZOOM_connection_p::cookies, ZOOM_connection_p::cs, ZOOM_connection_p::diagset, ZOOM_connection_p::group, ZOOM_connection_p::host_port, initlog(), ZOOM_connection_p::lang, ZOOM_connection_p::last_event, ZOOM_connection_p::len_in, ZOOM_connection_p::len_out, ZOOM_connection_p::location, ZOOM_connection_p::log_api, log_api0, ZOOM_connection_p::log_details, log_details0, ZOOM_connection_p::m_queue_back, ZOOM_connection_p::m_queue_front, ZOOM_connection_p::maximum_record_size, ZOOM_connection_p::no_redirects, odr_createmem(), ODR_DECODE, ODR_ENCODE, ZOOM_connection_p::odr_in, ZOOM_connection_p::odr_out, ZOOM_connection_p::odr_print, ZOOM_connection_p::odr_save, options(), ZOOM_connection_p::options, ZOOM_connection_p::password, ZOOM_connection_p::preferred_message_size, ZOOM_connection_p::proto, PROTO_Z3950, ZOOM_connection_p::proxy, ZOOM_connection_p::proxy_mode, ZOOM_connection_p::reconnect_ok, ZOOM_connection_p::resultsets, ZOOM_connection_p::saveAPDU_wrbuf, ZOOM_connection_p::sru_version, ZOOM_connection_p::state, STATE_IDLE, ZOOM_connection_p::support_named_resultsets, ZOOM_connection_p::tasks, ZOOM_connection_p::tproxy, ZOOM_connection_p::url_authentication, ZOOM_connection_p::user, xmalloc, yaz_log(), ZOOM_connection_set_mask(), ZOOM_ERROR_NONE, ZOOM_EVENT_NONE, ZOOM_memcached_init(), ZOOM_options_create_with_parent(), and ZOOM_set_error().
Referenced by ZOOM_connection_new(), and ZOOM_query_cql2rpn().
ZOOM_connection_destroy | ( | ZOOM_connection | c | ) |
Definition at line 605 of file zoom-c.c.
References ZOOM_resultset_p::connection, cs_close, ZOOM_resultset_p::next, odr_destroy(), wrbuf_destroy(), xfree, yaz_cookies_destroy(), yaz_log(), ZOOM_connection_remove_events(), ZOOM_connection_remove_tasks(), ZOOM_memcached_destroy(), and ZOOM_options_destroy().
Referenced by ZOOM_query_cql2rpn().
ZOOM_connection_diagset | ( | ZOOM_connection | c | ) |
Definition at line 1868 of file zoom-c.c.
References ZOOM_connection_error_x().
|
static |
Definition at line 1957 of file zoom-c.c.
References ZOOM_connection_p::cs, CS_CONNECT, CS_DATA, cs_look(), CS_NONE, cs_rcvconnect, CS_WANT_READ, CS_WANT_WRITE, do_read(), get_cert(), ZOOM_connection_p::host_port, comstack::io_pending, ZOOM_connection_p::location, ZOOM_connection_p::log_details, mask, ZOOM_connection_p::proto, PROTO_Z3950, send_HTTP_redirect(), ZOOM_connection_p::state, STATE_ESTABLISHED, ZOOM_connection_p::tasks, ZOOM_task_p::which, yaz_log(), ZOOM_connection_close(), ZOOM_connection_exec_task(), ZOOM_connection_put_event(), ZOOM_connection_remove_task(), ZOOM_connection_set_mask(), ZOOM_connection_Z3950_send_init(), ZOOM_ERROR_CONNECT, ZOOM_ERROR_CONNECTION_LOST, ZOOM_EVENT_CONNECT, ZOOM_Event_create(), ZOOM_SELECT_EXCEPT, ZOOM_SELECT_READ, ZOOM_SELECT_WRITE, ZOOM_send_buf(), ZOOM_set_error(), ZOOM_TASK_CONNECT, and ZOOM_test_reconnect().
ZOOM_connection_errcode | ( | ZOOM_connection | c | ) |
Definition at line 1846 of file zoom-c.c.
References ZOOM_connection_error().
ZOOM_connection_errmsg | ( | ZOOM_connection | c | ) |
Definition at line 1852 of file zoom-c.c.
References ZOOM_connection_error().
ZOOM_connection_error | ( | ZOOM_connection | c, |
const char ** | cp, | ||
const char ** | addinfo | ||
) |
Definition at line 1951 of file zoom-c.c.
References ZOOM_connection_error_x().
Referenced by ZOOM_connection_addinfo(), ZOOM_connection_errcode(), and ZOOM_connection_errmsg().
ZOOM_connection_error_x | ( | ZOOM_connection | c, |
const char ** | cp, | ||
const char ** | addinfo, | ||
const char ** | diagset | ||
) |
Definition at line 1926 of file zoom-c.c.
References yaz_diag_srw_str(), z_HTTP_errmsg(), and ZOOM_diag_str().
Referenced by ZOOM_connection_diagset(), and ZOOM_connection_error().
ZOOM_connection_exec_task | ( | ZOOM_connection | c | ) |
executes non-blocking tasks for connection
c | connection |
0 | no task was executed |
1 | task was executed (but probably not completed) |
This function, unlike, ZOOM_connection_process, does not try to return any events (and remove them). But events may be generated from it. These are saved and may later be retrieved with ZOOM_connection_process and ZOOM_connection_last_event .
Definition at line 1435 of file zoom-c.c.
References do_connect(), PROTO_HTTP, ZOOM_task_p::running, send_package(), send_Z3950_sort(), ZOOM_task_p::which, yaz_log(), zoom_complete, ZOOM_connection_remove_task(), ZOOM_connection_remove_tasks(), ZOOM_connection_srw_send_scan(), ZOOM_connection_srw_send_search(), ZOOM_connection_Z3950_search(), ZOOM_connection_Z3950_send_scan(), ZOOM_ERROR_NONE, ZOOM_query_get_sortspec(), ZOOM_TASK_CONNECT, ZOOM_TASK_PACKAGE, ZOOM_TASK_SCAN, ZOOM_TASK_SEARCH, and ZOOM_TASK_SORT.
Referenced by do_connect_host(), ZOOM_connection_do_io(), ZOOM_connection_process(), and ZOOM_handle_Z3950_apdu().
char** ZOOM_connection_get_databases | ( | ZOOM_connection | con, |
ZOOM_options | options, | ||
int * | num, | ||
ODR | odr | ||
) |
Definition at line 322 of file zoom-c.c.
References cs_get_host_args(), ZOOM_connection_p::host_port, nmem_strsplit(), odr_getmem, options(), and ZOOM_options_get().
Referenced by create_admin_package(), create_update_package(), ZOOM_connection_scan1(), and ZOOM_connection_search().
ZOOM_task ZOOM_connection_insert_task | ( | ZOOM_connection | c, |
int | which | ||
) |
Definition at line 171 of file zoom-c.c.
References ZOOM_task_p::next, ZOOM_task_p::running, ZOOM_connection_p::tasks, ZOOM_task_p::which, and xmalloc.
Referenced by handle_http(), and ZOOM_test_reconnect().
ZOOM_connection_last_event | ( | ZOOM_connection | cs | ) |
Definition at line 2035 of file zoom-c.c.
References ZOOM_EVENT_NONE.
ZOOM_connection_new | ( | const char * | host, |
int | portnum | ||
) |
Definition at line 337 of file zoom-c.c.
References ZOOM_connection_connect(), and ZOOM_connection_create().
ZOOM_connection_option_get | ( | ZOOM_connection | c, |
const char * | key | ||
) |
Definition at line 1770 of file zoom-c.c.
References wrbuf_cstr(), and ZOOM_options_get().
Referenced by cql2pqf().
ZOOM_connection_option_getl | ( | ZOOM_connection | c, |
const char * | key, | ||
int * | lenp | ||
) |
Definition at line 1781 of file zoom-c.c.
References wrbuf_cstr(), wrbuf_len, and ZOOM_options_getl().
ZOOM_connection_option_set | ( | ZOOM_connection | c, |
const char * | key, | ||
const char * | val | ||
) |
Definition at line 1801 of file zoom-c.c.
References wrbuf_alloc(), wrbuf_destroy(), wrbuf_rewind(), and ZOOM_options_set().
Referenced by set_init_option(), ZOOM_connection_connect(), and ZOOM_handle_Z3950_apdu().
ZOOM_connection_option_setl | ( | ZOOM_connection | c, |
const char * | key, | ||
const char * | val, | ||
int | len | ||
) |
ZOOM_connection_package | ( | ZOOM_connection | c, |
ZOOM_options | options | ||
) |
Definition at line 1379 of file zoom-c.c.
References ZOOM_package_p::buf_out, ZOOM_package_p::connection, ZOOM_package_p::len_out, odr_createmem(), ODR_ENCODE, ZOOM_package_p::odr_out, options(), ZOOM_package_p::options, ZOOM_package_p::refcount, xmalloc, and ZOOM_options_create_with_parent2().
ZOOM_connection_process | ( | ZOOM_connection | c | ) |
process one event for connection
c | connection |
0 | no event was processed |
1 | event was processed for connection |
This function attemps to deal with outstandings events in a non-blocking fashion. If no event was processed (return value of 0), then the system should attempt to deal with sockets in blocking mode using socket select/poll which means calling the following functions: ZOOM_connection_get_socket, ZOOM_connection_get_mask, ZOOM_connection_get_timeout. If an event was processed call this function again.
Definition at line 2057 of file zoom-c.c.
References ZOOM_connection_exec_task(), ZOOM_connection_get_event(), and ZOOM_Event_destroy().
Referenced by ZOOM_event_nonblock().
void ZOOM_connection_remove_task | ( | ZOOM_connection | c | ) |
Definition at line 183 of file zoom-c.c.
References ZOOM_task_p::next, ZOOM_task_p::package, resultset_destroy(), ZOOM_task_p::scan, ZOOM_task_p::search, ZOOM_task_p::sort, ZOOM_connection_p::tasks, ZOOM_task_p::u, ZOOM_task_p::which, xfree, ZOOM_connection_put_event(), ZOOM_Event_create(), ZOOM_EVENT_END, ZOOM_package_destroy(), ZOOM_query_destroy(), ZOOM_scanset_destroy(), ZOOM_TASK_CONNECT, ZOOM_TASK_PACKAGE, ZOOM_TASK_SCAN, ZOOM_TASK_SEARCH, and ZOOM_TASK_SORT.
Referenced by do_connect_host(), handle_http(), ZOOM_connection_do_io(), ZOOM_connection_exec_task(), ZOOM_connection_remove_tasks(), and ZOOM_handle_Z3950_apdu().
void ZOOM_connection_remove_tasks | ( | ZOOM_connection | c | ) |
Definition at line 223 of file zoom-c.c.
References ZOOM_connection_p::tasks, and ZOOM_connection_remove_task().
Referenced by handle_Z3950_records(), handle_Z3950_sort_response(), ZOOM_connection_connect(), ZOOM_connection_destroy(), and ZOOM_connection_exec_task().
ZOOM_connection_scan | ( | ZOOM_connection | c, |
const char * | start | ||
) |
Definition at line 1177 of file zoom-c.c.
References ZOOM_connection_scan1(), ZOOM_query_create(), ZOOM_query_destroy(), and ZOOM_query_prefix().
ZOOM_connection_scan1 | ( | ZOOM_connection | c, |
ZOOM_query | q | ||
) |
Definition at line 1191 of file zoom-c.c.
References ZOOM_scanset_p::connection, ZOOM_scanset_p::databaseNames, ZOOM_scanset_p::num_databaseNames, ZOOM_scanset_p::odr, odr_createmem(), ODR_DECODE, ZOOM_scanset_p::options, ZOOM_scanset_p::query, ZOOM_scanset_p::refcount, ZOOM_task_p::scan, ZOOM_scanset_p::scan_response, ZOOM_scanset_p::srw_scan_response, ZOOM_task_p::u, xmalloc, ZOOM_connection_add_task(), ZOOM_connection_get_databases(), ZOOM_event(), ZOOM_options_create_with_parent(), ZOOM_query_addref(), ZOOM_query_get_Z_Query(), and ZOOM_TASK_SCAN.
Referenced by ZOOM_connection_scan().
ZOOM_connection_search | ( | ZOOM_connection | c, |
ZOOM_query | q | ||
) |
Definition at line 735 of file zoom-c.c.
References ZOOM_resultset_p::connection, ZOOM_resultset_p::databaseNames, ZOOM_resultset_p::next, ZOOM_resultset_p::num_databaseNames, ZOOM_resultset_p::odr, odr_strdup_null(), ZOOM_resultset_p::options, ZOOM_resultset_p::piggyback, PROTO_HTTP, ZOOM_resultset_p::query, ZOOM_resultset_p::r_sort_spec, ZOOM_resultset_p::req_facets, ZOOM_task_p::search, ZOOM_resultset_p::setname, ZOOM_resultset_p::step, ZOOM_task_p::u, xstrdup, yaz_log(), ZOOM_connection_add_task(), ZOOM_connection_get_databases(), ZOOM_event(), ZOOM_memcached_resultset(), ZOOM_options_create_with_parent(), ZOOM_options_get(), ZOOM_options_get_bool(), ZOOM_options_get_int(), ZOOM_query_addref(), ZOOM_query_get_sortspec(), ZOOM_resultset_addref(), ZOOM_resultset_create(), ZOOM_TASK_CONNECT, and ZOOM_TASK_SEARCH.
Referenced by ZOOM_connection_search_pqf().
ZOOM_connection_search_pqf | ( | ZOOM_connection | c, |
const char * | q | ||
) |
Definition at line 722 of file zoom-c.c.
References ZOOM_connection_search(), ZOOM_query_create(), ZOOM_query_destroy(), and ZOOM_query_prefix().
void ZOOM_connection_show_task | ( | ZOOM_task | task | ) |
Definition at line 129 of file zoom-c.c.
References ZOOM_task_p::which, yaz_log(), YLOG_LOG, ZOOM_TASK_CONNECT, ZOOM_TASK_SCAN, and ZOOM_TASK_SEARCH.
Referenced by ZOOM_connection_show_tasks().
void ZOOM_connection_show_tasks | ( | ZOOM_connection | c | ) |
Definition at line 145 of file zoom-c.c.
References ZOOM_task_p::next, ZOOM_connection_p::tasks, yaz_log(), YLOG_LOG, and ZOOM_connection_show_task().
ZOOM_diag_str | ( | int | error | ) |
Definition at line 1876 of file zoom-c.c.
References diagbib1_str(), ZOOM_ERROR_CCL_CONFIG, ZOOM_ERROR_CCL_PARSE, ZOOM_ERROR_CONNECT, ZOOM_ERROR_CONNECTION_LOST, ZOOM_ERROR_CQL_PARSE, ZOOM_ERROR_CQL_TRANSFORM, ZOOM_ERROR_DECODE, ZOOM_ERROR_ENCODE, ZOOM_ERROR_ES_INVALID_ACTION, ZOOM_ERROR_ES_INVALID_SYNTAX, ZOOM_ERROR_ES_INVALID_VERSION, ZOOM_ERROR_INIT, ZOOM_ERROR_INTERNAL, ZOOM_ERROR_INVALID_QUERY, ZOOM_ERROR_MEMCACHED, ZOOM_ERROR_MEMORY, ZOOM_ERROR_NONE, ZOOM_ERROR_TIMEOUT, ZOOM_ERROR_UNSUPPORTED_PROTOCOL, and ZOOM_ERROR_UNSUPPORTED_QUERY.
Referenced by ZOOM_connection_error_x().
ZOOM_event_nonblock | ( | int | no, |
ZOOM_connection * | cs | ||
) |
process one event for one of connections given
no | number of connections (size of cs) |
cs | connection array |
0 | no event was processed |
>0 | event was processed for connection at (retval-1) |
This function attemps to deal with outstandings events in a non-blocking mode. If no events was processed (return value of 0), then the system should attempt to deal with sockets in blocking mode using socket select/poll which means calling the following functions: ZOOM_connection_get_socket, ZOOM_connection_get_mask, ZOOM_connection_get_timeout.
Definition at line 2080 of file zoom-c.c.
References log_details0, yaz_log(), and ZOOM_connection_process().
Referenced by ZOOM_event().
ZOOM_facet_field_get_term | ( | ZOOM_facet_field | field, |
size_t | idx, | ||
int * | freq | ||
) |
ZOOM_facet_field_name | ( | ZOOM_facet_field | field | ) |
Definition at line 1034 of file zoom-c.c.
Referenced by ZOOM_handle_facet_list().
ZOOM_facet_field_term_count | ( | ZOOM_facet_field | field | ) |
ZOOM_package_destroy | ( | ZOOM_package | p | ) |
Definition at line 1393 of file zoom-c.c.
References odr_destroy(), xfree, and ZOOM_options_destroy().
Referenced by ZOOM_connection_remove_task().
ZOOM_package_option_get | ( | ZOOM_package | p, |
const char * | key | ||
) |
Definition at line 1409 of file zoom-c.c.
References ZOOM_options_get().
ZOOM_package_option_getl | ( | ZOOM_package | p, |
const char * | key, | ||
int * | lenp | ||
) |
Definition at line 1415 of file zoom-c.c.
References ZOOM_options_getl().
ZOOM_package_option_set | ( | ZOOM_package | p, |
const char * | key, | ||
const char * | val | ||
) |
Definition at line 1421 of file zoom-c.c.
References ZOOM_options_set().
ZOOM_package_option_setl | ( | ZOOM_package | p, |
const char * | key, | ||
const char * | val, | ||
int | len | ||
) |
Definition at line 1428 of file zoom-c.c.
References ZOOM_options_setl().
void ZOOM_resultset_addref | ( | ZOOM_resultset | r | ) |
Definition at line 649 of file zoom-c.c.
References log_details0, ZOOM_resultset_p::mutex, ZOOM_resultset_p::refcount, yaz_log(), yaz_mutex_enter(), and yaz_mutex_leave().
Referenced by ZOOM_connection_search(), ZOOM_resultset_retrieve(), and ZOOM_resultset_sort1().
ZOOM_resultset ZOOM_resultset_create | ( | void | ) |
Definition at line 682 of file zoom-c.c.
References ZOOM_resultset_p::connection, ZOOM_resultset_p::databaseNames, ZOOM_resultset_p::facets_names, initlog(), ZOOM_resultset_p::live_set, log_details0, ZOOM_resultset_p::mc_key, ZOOM_resultset_p::mutex, ZOOM_resultset_p::num_databaseNames, ZOOM_resultset_p::num_res_facets, ZOOM_resultset_p::odr, odr_createmem(), ODR_DECODE, ZOOM_resultset_p::piggyback, ZOOM_resultset_p::query, ZOOM_resultset_p::r_sort_spec, ZOOM_resultset_p::record_hash, RECORD_HASH_SIZE, ZOOM_resultset_p::record_wrbuf, ZOOM_resultset_p::refcount, ZOOM_resultset_p::req_facets, ZOOM_resultset_p::res_facets, resultset_use(), ZOOM_resultset_p::setname, ZOOM_resultset_p::size, ZOOM_resultset_p::step, wrbuf_alloc(), xmalloc, yaz_log(), yaz_mutex_create(), and YAZ_SHPTR_INIT.
Referenced by ZOOM_connection_search().
ZOOM_resultset_destroy | ( | ZOOM_resultset | r | ) |
Definition at line 863 of file zoom-c.c.
References resultset_destroy().
ZOOM_resultset_facets | ( | ZOOM_resultset | r | ) |
ZOOM_resultset_facets_names | ( | ZOOM_resultset | r | ) |
ZOOM_resultset_facets_size | ( | ZOOM_resultset | r | ) |
ZOOM_resultset_get_facet_field | ( | ZOOM_resultset | r, |
const char * | name | ||
) |
ZOOM_resultset_get_facet_field_by_index | ( | ZOOM_resultset | r, |
int | idx | ||
) |
ZOOM_resultset_option_get | ( | ZOOM_resultset | r, |
const char * | key | ||
) |
Definition at line 1832 of file zoom-c.c.
References ZOOM_options_get().
Referenced by ZOOM_connection_srw_send_search(), and ZOOM_memcached_resultset().
ZOOM_resultset_option_set | ( | ZOOM_resultset | r, |
const char * | key, | ||
const char * | val | ||
) |
Definition at line 1838 of file zoom-c.c.
References ZOOM_options_set().
Referenced by handle_srw_response().
ZOOM_resultset_record | ( | ZOOM_resultset | r, |
size_t | pos | ||
) |
Definition at line 1156 of file zoom-c.c.
References ZOOM_resultset_record_immediate(), and ZOOM_resultset_retrieve().
ZOOM_resultset_record_immediate | ( | ZOOM_resultset | s, |
size_t | pos | ||
) |
Definition at line 1143 of file zoom-c.c.
References ZOOM_options_get(), and ZOOM_record_cache_lookup_i().
Referenced by ZOOM_resultset_record(), and ZOOM_resultset_records().
ZOOM_resultset_records | ( | ZOOM_resultset | r, |
ZOOM_record * | recs, | ||
size_t | start, | ||
size_t | count | ||
) |
Definition at line 973 of file zoom-c.c.
References log_api0, yaz_log(), ZOOM_resultset_record_immediate(), and ZOOM_resultset_retrieve().
|
static |
Definition at line 921 of file zoom-c.c.
References ZOOM_connection_p::async, ZOOM_resultset_p::connection, ZOOM_connection_p::cs, ZOOM_connection_p::host_port, log_details0, ZOOM_resultset_p::options, ZOOM_connection_p::proto, PROTO_HTTP, ZOOM_connection_p::reconnect_ok, ZOOM_task_p::search, ZOOM_task_p::u, xstrdup, yaz_log(), ZOOM_connection_add_task(), ZOOM_event(), ZOOM_options_get(), ZOOM_resultset_addref(), ZOOM_TASK_CONNECT, and ZOOM_TASK_SEARCH.
Referenced by ZOOM_resultset_record(), and ZOOM_resultset_records().
ZOOM_resultset_size | ( | ZOOM_resultset | r | ) |
ZOOM_resultset_sort | ( | ZOOM_resultset | r, |
const char * | sort_type, | ||
const char * | sort_spec | ||
) |
Definition at line 808 of file zoom-c.c.
References ZOOM_resultset_sort1().
ZOOM_resultset_sort1 | ( | ZOOM_resultset | r, |
const char * | sort_type, | ||
const char * | sort_spec | ||
) |
Definition at line 815 of file zoom-c.c.
References ZOOM_connection_p::async, ZOOM_connection_p::cs, ZOOM_connection_p::host_port, ZOOM_connection_p::log_api, ZOOM_connection_p::log_details, ZOOM_connection_p::proto, PROTO_HTTP, ZOOM_connection_p::reconnect_ok, ZOOM_task_p::sort, ZOOM_task_p::u, yaz_log(), ZOOM_connection_add_task(), ZOOM_event(), ZOOM_query_create(), ZOOM_query_sortby(), ZOOM_resultset_addref(), ZOOM_resultset_cache_reset(), ZOOM_TASK_CONNECT, and ZOOM_TASK_SORT.
Referenced by ZOOM_resultset_sort().
ZOOM_scanset_destroy | ( | ZOOM_scanset | scan | ) |
Definition at line 1228 of file zoom-c.c.
References odr_destroy(), xfree, ZOOM_options_destroy(), and ZOOM_query_destroy().
Referenced by ZOOM_connection_remove_task().
ZOOM_scanset_display_term | ( | ZOOM_scanset | scan, |
size_t | pos, | ||
size_t * | occ, | ||
size_t * | len | ||
) |
Definition at line 1349 of file zoom-c.c.
References ZOOM_scanset_term_x().
ZOOM_scanset_option_get | ( | ZOOM_scanset | scan, |
const char * | key | ||
) |
Definition at line 1365 of file zoom-c.c.
References ZOOM_options_get().
ZOOM_scanset_option_set | ( | ZOOM_scanset | scan, |
const char * | key, | ||
const char * | val | ||
) |
Definition at line 1371 of file zoom-c.c.
References ZOOM_options_set().
ZOOM_scanset_size | ( | ZOOM_scanset | scan | ) |
Definition at line 1263 of file zoom-c.c.
Referenced by ZOOM_scanset_term_x().
ZOOM_scanset_term | ( | ZOOM_scanset | scan, |
size_t | pos, | ||
size_t * | occ, | ||
size_t * | len | ||
) |
Definition at line 1333 of file zoom-c.c.
References ZOOM_scanset_term_x().
|
static |
Definition at line 1275 of file zoom-c.c.
References odr_oct::buf, Z_SRW_scanTerm::displayTerm, Z_TermInfo::displayTerm, Z_ScanResponse::entries, Z_ListEntries::entries, Z_Term::general, Z_TermInfo::globalOccurrences, odr_oct::len, Z_SRW_scanTerm::numberOfRecords, ZOOM_scanset_p::scan_response, ZOOM_scanset_p::srw_scan_response, Z_TermInfo::term, Z_Entry::termInfo, Z_SRW_scanResponse::terms, Z_Term::u, Z_Entry::u, Z_SRW_scanTerm::value, Z_Term::which, Z_Entry::which, Z_Entry_termInfo, Z_Term_general, and ZOOM_scanset_size().
Referenced by ZOOM_scanset_display_term(), and ZOOM_scanset_term().
zoom_ret ZOOM_send_buf | ( | ZOOM_connection | c | ) |
Definition at line 1763 of file zoom-c.c.
References ZOOM_connection_p::buf_out, do_write_ex(), and ZOOM_connection_p::len_out.
Referenced by send_APDU(), send_package(), ZOOM_connection_do_io(), and ZOOM_send_GDU().
zoom_ret ZOOM_send_GDU | ( | ZOOM_connection | c, |
Z_GDU * | gdu | ||
) |
Definition at line 1526 of file zoom-c.c.
References ZOOM_connection_p::buf_out, ZOOM_connection_p::len_out, odr_getbuf(), ZOOM_connection_p::odr_out, ZOOM_connection_p::odr_print, odr_reset(), ZOOM_connection_p::odr_save, z_GDU(), zoom_complete, ZOOM_connection_put_event(), ZOOM_Event_create(), ZOOM_EVENT_SEND_APDU, and ZOOM_send_buf().
Referenced by send_HTTP_redirect(), and send_srw().
void ZOOM_set_dset_error | ( | ZOOM_connection | c, |
int | error, | ||
const char * | dset, | ||
const char * | addinfo, | ||
const char * | addinfo2 | ||
) |
Definition at line 54 of file zoom-c.c.
References ZOOM_connection_p::addinfo, ZOOM_connection_p::diagset, ZOOM_connection_p::error, ZOOM_connection_p::host_port, ZOOM_connection_p::log_api, xfree, xmalloc, xstrdup, yaz_log(), and ZOOM_ERROR_NONE.
Referenced by response_default_diag(), set_SRU_error(), ZOOM_connection_Z3950_search(), ZOOM_handle_Z3950_apdu(), ZOOM_set_error(), and ZOOM_set_HTTP_error().
void ZOOM_set_error | ( | ZOOM_connection | c, |
int | error, | ||
const char * | addinfo | ||
) |
Definition at line 98 of file zoom-c.c.
References ZOOM_set_dset_error().
Referenced by clear_error(), cql2pqf(), create_update_package(), do_connect_host(), do_read(), do_write_ex(), encode_APDU(), handle_http(), handle_Z3950_es_response(), handle_Z3950_records(), response_diag(), Z3950_send_search(), ZOOM_connection_connect(), ZOOM_connection_create(), ZOOM_connection_do_io(), ZOOM_connection_srw_send_scan(), ZOOM_connection_srw_send_search(), ZOOM_connection_Z3950_send_scan(), ZOOM_handle_Z3950_apdu(), and ZOOM_memcached_configure().
void ZOOM_set_HTTP_error | ( | ZOOM_connection | c, |
int | error, | ||
const char * | addinfo, | ||
const char * | addinfo2 | ||
) |
Definition at line 1546 of file zoom-c.c.
References ZOOM_set_dset_error().
Referenced by handle_http(), and ZOOM_handle_sru().
int ZOOM_test_reconnect | ( | ZOOM_connection | c | ) |
Definition at line 904 of file zoom-c.c.
References ZOOM_connection_p::reconnect_ok, ZOOM_task_p::running, ZOOM_connection_p::tasks, ZOOM_connection_close(), ZOOM_connection_insert_task(), ZOOM_connection_put_event(), ZOOM_EVENT_CONNECT, ZOOM_Event_create(), and ZOOM_TASK_CONNECT.
Referenced by do_read(), do_write_ex(), ZOOM_connection_do_io(), and ZOOM_handle_Z3950_apdu().
int ZOOM_uri_to_code | ( | const char * | uri | ) |
Definition at line 89 of file zoom-c.c.
Referenced by set_SRU_error(), and ZOOM_record_error().
|
static |
Definition at line 662 of file zoom-c.c.
Referenced by resultset_use().
|
static |
Definition at line 661 of file zoom-c.c.
Referenced by resultset_use().
|
static |
Definition at line 34 of file zoom-c.c.
Referenced by initlog(), ZOOM_connection_create(), and ZOOM_resultset_records().
|
static |
Definition at line 35 of file zoom-c.c.
Referenced by initlog(), resultset_destroy(), ZOOM_connection_create(), ZOOM_event_nonblock(), ZOOM_resultset_addref(), ZOOM_resultset_create(), and ZOOM_resultset_retrieve().