+Increase various buffers in GFS's statserv_options_block
Change many 'unsigned char *' to 'char *' for ODR-related utilties.
This change makes many type-casts redundant, and, thus simplifies code.
+Remove last bits of WAIS support.
+
Remove member 'size' from Odr_oct.
Slim down the public part of 'struct odr'. Most elements are not part
void *handle; /* private handle to the backend module */
} bend_initresult;
+#define BEND_NAME_MAX 1024
+
/** \brief control block for server */
typedef struct statserv_options_block
{
int dynamic; /**< fork on incoming requests */
int threads; /**< use threads */
int one_shot; /**< one session then exit(1) */
- char apdufile[ODR_MAXNAME+1]; /**< file for pretty-printed PDUs */
- char logfile[ODR_MAXNAME+1]; /**< file for diagnostic output */
- char default_listen[1024]; /**< 0 == no default listen */
+ char apdufile[BEND_NAME_MAX]; /**< file for pretty-printed PDUs */
+ char logfile[BEND_NAME_MAX]; /**< file for diagnostic output */
enum oid_proto default_proto; /**< PROTO_SR or PROTO_Z3950 */
int idle_timeout; /**< how many minutes to wait before closing */
int maxrecordsize; /**< maximum value for negotiation */
- char configname[ODR_MAXNAME+1]; /**< given to the backend in bend_init */
- char setuid[ODR_MAXNAME+1]; /**< setuid to this user after binding */
+ char configname[BEND_NAME_MAX]; /**< given to the backend in bend_init */
+ char setuid[BEND_NAME_MAX]; /**< setuid to this user after binding */
void (*bend_start)(struct statserv_options_block *p);
void (*bend_stop)(struct statserv_options_block *p);
int (*options_func)(int argc, char **argv);
int (*check_ip)(void *cd, const char *addr, int len, int type);
- char daemon_name[128];
+ char daemon_name[BEND_NAME_MAX];
int inetd; /**< Do we use the inet deamon or not */
void *handle; /**< Handle */
#ifdef WIN32
/* We only have these members for the windows version */
/* They seemed a bit large to have them there in general */
- char service_name[128]; /**< NT Service Name */
- char app_name[128]; /**< Application Name */
- char service_dependencies[128]; /**< The services we are dependent on */
- char service_display_name[128]; /**< The service display name */
+ char service_name[BEND_NAME_MAX];/**< NT Service Name */
+ char app_name[BEND_NAME_MAX]; /**< Application Name */
+ char service_dependencies[BEND_NAME_MAX];
+ char service_display_name[BEND_NAME_MAX];
#endif /* WIN32 */
- struct bend_soap_handler *soap_handlers;
- char pid_fname[128]; /**< pid fname */
- int background; /**< auto daemon */
- char cert_fname[128]; /**< SSL certificate fname */
- char xml_config[128]; /**< XML config filename */
- int keepalive; /**< keep alive if HTTP 1.1 (default: 1) */
+ char pid_fname[BEND_NAME_MAX]; /**< pid fname */
+ int background; /**< auto daemon */
+ char cert_fname[BEND_NAME_MAX];/**< SSL certificate fname */
+ char xml_config[BEND_NAME_MAX];/**< XML config filename */
+ int keepalive; /**< keep alive if HTTP 1.1 (default: 1) */
} statserv_options_block;
YAZ_EXPORT int statserv_main(
YAZ_BEGIN_CDECL
-#define COMSTACK_DEFAULT_TIMEOUT -1 /* not used yet */
-
struct comstack;
typedef struct comstack *COMSTACK;
typedef COMSTACK (*CS_TYPE)(int s, int flags, int protocol, void *vp);
CS_TYPE type;
int cerrno; /* current error code of this stack */
int iofile; /* UNIX file descriptor for iochannel */
- int timeout; /* how long to wait for trailing blocks (ignored for now) */
void *cprivate;/* state info for lower stack */
int max_recv_bytes; /* max size of incoming package */
int state; /* current state */
YAZ_EXPORT int cs_set_ssl_certificate_file(COMSTACK cs, const char *fname);
YAZ_EXPORT int cs_get_peer_certificate_x509(COMSTACK cs, char **buf, int *len);
YAZ_EXPORT void cs_set_max_recv_bytes(COMSTACK cs, int max_recv_bytes);
-YAZ_EXPORT int completeWAIS(const char *buf, int len);
-
YAZ_EXPORT void cs_print_session_info(COMSTACK cs);
/*
#define CSBUFSIZE 7
#define CSLASTERROR CSBUFSIZE /* must be the value of last CS error */
-/* backwards compatibility */
-#define CS_SR PROTO_SR
-#define CS_Z3950 PROTO_Z3950
-
#define CS_FLAGS_BLOCKING 1
#define CS_FLAGS_NUMERICHOST 2
*/
YAZ_EXPORT yaz_icu_chain_t icu_chain_xml_config(const xmlNode *xml_node,
int sort,
- UErrorCode * status);
+ UErrorCode *status);
/** \brief pass string to ICU for parsing/tokenization/etc
\param chain ICU chain to be used for parsing
\param src8cstr input C string (null-terminated)
\retval 1 success
*/
YAZ_EXPORT int icu_chain_assign_cstr(yaz_icu_chain_t chain,
- const char * src8cstr,
+ const char *src8cstr,
UErrorCode *status);
/** \brief returns one token (if any)
/* declared structs and functions */
-int icu_check_status (UErrorCode status);
+int icu_check_status(UErrorCode status);
struct icu_buf_utf16
{
struct icu_casemap;
-struct icu_casemap * icu_casemap_create(char action, UErrorCode *status);
+struct icu_casemap *icu_casemap_create(char action, UErrorCode *status);
struct icu_casemap *icu_casemap_clone(struct icu_casemap *old);
-void icu_casemap_destroy(struct icu_casemap * casemap);
+void icu_casemap_destroy(struct icu_casemap *casemap);
-int icu_casemap_casemap(struct icu_casemap * casemap,
- struct icu_buf_utf16 * dest16,
- struct icu_buf_utf16 * src16,
+int icu_casemap_casemap(struct icu_casemap *casemap,
+ struct icu_buf_utf16 *dest16,
+ struct icu_buf_utf16 *src16,
UErrorCode *status,
const char *locale);
-int icu_utf16_casemap(struct icu_buf_utf16 * dest16,
- struct icu_buf_utf16 * src16,
+int icu_utf16_casemap(struct icu_buf_utf16 *dest16,
+ struct icu_buf_utf16 *src16,
const char *locale, char action,
UErrorCode *status);
void icu_sortkey8_from_utf16(UCollator *coll,
- struct icu_buf_utf8 * dest8,
- struct icu_buf_utf16 * src16,
- UErrorCode * status);
+ struct icu_buf_utf8 *dest8,
+ struct icu_buf_utf16 *src16,
+ UErrorCode *status);
struct icu_tokenizer;
struct icu_tokenizer * icu_tokenizer_create(const char *locale, char action,
UErrorCode *status);
struct icu_tokenizer *icu_tokenizer_clone(struct icu_tokenizer *old);
-void icu_tokenizer_destroy(struct icu_tokenizer * tokenizer);
+void icu_tokenizer_destroy(struct icu_tokenizer *tokenizer);
-int icu_tokenizer_attach(struct icu_tokenizer * tokenizer,
- struct icu_buf_utf16 * src16, UErrorCode *status);
+int icu_tokenizer_attach(struct icu_tokenizer *tokenizer,
+ struct icu_buf_utf16 *src16, UErrorCode *status);
-int32_t icu_tokenizer_next_token(struct icu_tokenizer * tokenizer,
- struct icu_buf_utf16 * tkn16,
+int32_t icu_tokenizer_next_token(struct icu_tokenizer *tokenizer,
+ struct icu_buf_utf16 *tkn16,
UErrorCode *status,
size_t *start, size_t *len);
struct icu_transform *icu_transform_clone(struct icu_transform *old);
void icu_transform_destroy(struct icu_transform * transform);
-int icu_transform_trans(struct icu_transform * transform,
- struct icu_buf_utf16 * dest16,
- const struct icu_buf_utf16 * src16,
+int icu_transform_trans(struct icu_transform *transform,
+ struct icu_buf_utf16 *dest16,
+ const struct icu_buf_utf16 *src16,
UErrorCode *status);
struct icu_chain_step;
int icu_chain_token_number(yaz_icu_chain_t chain);
-yaz_icu_chain_t icu_chain_create(const char * locale,
- int sort,
- UErrorCode * status);
+yaz_icu_chain_t icu_chain_create(const char *locale,
+ int sort, UErrorCode *status);
#endif /* ICU_I18NL_H */
{
PROTO_NOP=0,
PROTO_Z3950,
- PROTO_SR,
- PROTO_GENERAL,
- PROTO_WAIS,
PROTO_HTTP
} oid_proto;
odr_seq.c odr_oct.c ber_oct.c odr_bit.c ber_bit.c odr_oid.c \
ber_oid.c odr_use.c odr_choice.c odr_any.c ber_any.c odr.c odr_mem.c \
dumpber.c odr_enum.c odr-priv.h \
- comstack.c tcpip.c waislen.c unix.c \
+ comstack.c tcpip.c unix.c \
prt-ext.c \
ill-get.c \
zget.c yaz-ccl.c diag-entry.c diag-entry.h \
0, /* one shot (single session) */
"", /* no PDUs */
"", /* diagnostic output to stderr */
- "tcp:@:9999", /* default listener port */
PROTO_Z3950, /* default application protocol */
900, /* idle timeout (seconds) */
64*1024*1024, /* maximum PDU size (approx.) to allow */
"", /* NT Service Dependencies */
"Z39.50 Server", /* NT Service Display Name */
#endif /* WIN32 */
- 0, /* SOAP handlers */
"", /* PID fname */
0, /* background daemon */
"", /* SSL certificate filename */
{
xml_config_add_listeners();
- if (!pListener && *control_block.default_listen)
- add_listener(control_block.default_listen, 0);
+ if (!pListener)
+ add_listener("tcp:@:9999", 0);
#ifndef WIN32
if (control_block.dynamic)
static void option_copy(char *dst, const char *src)
{
- strncpy(dst, src ? src : "", 127);
- dst[127] = '\0';
+ strncpy(dst, src ? src : "", BEND_NAME_MAX-1);
+ dst[BEND_NAME_MAX-1] = '\0';
}
int check_options(int argc, char **argv)
sp->altbuf = 0;
sp->altsize = sp->altlen = 0;
sp->towrite = sp->written = -1;
- if (protocol == PROTO_WAIS)
- sp->complete = completeWAIS;
- else
- sp->complete = cs_complete_auto;
+ sp->complete = cs_complete_auto;
sp->connect_request_buf = 0;
sp->connect_request_len = 0;
sp->connect_response_buf = 0;
sp->connect_response_len = 0;
- p->timeout = COMSTACK_DEFAULT_TIMEOUT;
TRC(fprintf(stderr, "Created new TCPIP comstack h=%p\n", p));
return p;
state->altbuf = 0;
state->altsize = state->altlen = 0;
state->towrite = state->written = -1;
- if (protocol == PROTO_WAIS)
- state->complete = completeWAIS;
- else
- state->complete = cs_complete_auto;
+ state->complete = cs_complete_auto;
- p->timeout = COMSTACK_DEFAULT_TIMEOUT;
TRC(fprintf(stderr, "Created new UNIX comstack\n"));
return p;
+++ /dev/null
-/* This file is part of the YAZ toolkit.
- * Copyright (C) 1995-2013 Index Data
- * See the file LICENSE for details.
- */
-/**
- * \file waislen.c
- * \brief Implements WAIS package handling
- */
-#if HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <stdio.h>
-#include <yaz/comstack.h>
-/*
- * Return length of WAIS package or 0
- */
-int completeWAIS(const char *buf, int len)
-{
- int i, lval = 0;
-
- if (len < 25)
- return 0;
- if (*buf != '0')
- return 0;
- /* calculate length */
- for (i = 0; i < 10; i++)
- lval = lval * 10 + (buf[i] - '0');
- lval += 25;
- if (len >= lval)
- return lval;
- return 0;
-}
-/*
- * Local variables:
- * c-basic-offset: 4
- * c-file-style: "Stroustrup"
- * indent-tabs-mode: nil
- * End:
- * vim: shiftwidth=4 tabstop=8 expandtab
- */
-
$(OBJDIR)\ccl_stop_words.obj \
$(OBJDIR)\comstack.obj \
$(OBJDIR)\tcpip.obj \
- $(OBJDIR)\waislen.obj \
$(OBJDIR)\ber_any.obj \
$(OBJDIR)\ber_bit.obj \
$(OBJDIR)\ber_bool.obj \