Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ AC_CONFIG_HEADERS([src/config.h])

AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_AUX_DIR([config])
AC_CANONICAL_TARGET

AC_DEFINE([_POSIX_C_SOURCE],[200809L],[Enable POSIX])

AM_INIT_AUTOMAKE([1.9])

Expand Down
11 changes: 3 additions & 8 deletions src/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ typedef int socklen_t;

#define MAX_HTTP_HEADER 4096

#ifdef WIN32
#define strncasecmp _strnicmp
#define strcasecmp _stricmp
#endif

struct http_buf
{
#define HTTP_BUF_SIZE 4096
Expand Down Expand Up @@ -120,7 +115,7 @@ const char *http_lookup_header(struct http_header *header,
const char *name)
{
for (; header; header = header->next)
if (!strcasecmp(name, header->name))
if (!yaz_strcasecmp(name, header->name))
return header->value;
return 0;
}
Expand Down Expand Up @@ -363,7 +358,7 @@ static int package_check(const char *buf, int sz)
}
buf = b;
// following first skip of \r\n so that we don't consider Method
if (!strncasecmp(buf, "Content-Length:", 15))
if (!yaz_strncasecmp(buf, "Content-Length:", 15))
{
const char *cp = buf+15;
while (*cp == ' ')
Expand Down Expand Up @@ -634,7 +629,7 @@ static struct http_buf *http_serialize_response(struct http_channel *c,
wrbuf_printf(c->wrbuf, "Content-Type: %s\r\n", r->content_type);
if (!strcmp(r->content_type, "text/xml"))
{
xmlDoc *doc = xmlParseMemory(r->payload, strlen(r->payload));
xmlDoc *doc = xmlReadMemory(r->payload, strlen(r->payload), 0, 0, 0);
if (doc)
{
xmlFreeDoc(doc);
Expand Down
4 changes: 2 additions & 2 deletions src/http_command.c
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static void cmd_init(struct http_channel *c)
ignored_content = 1;
else
{
xmlDoc *doc = xmlParseMemory(r->content_buf, r->content_len);
xmlDoc *doc = xmlReadMemory(r->content_buf, r->content_len, 0, 0, 0);
xmlNode *root_n;
if (!doc)
{
Expand Down Expand Up @@ -513,7 +513,7 @@ static void cmd_settings(struct http_channel *c)
}
else
{
xmlDoc *doc = xmlParseMemory(rq->content_buf, rq->content_len);
xmlDoc *doc = xmlReadMemory(rq->content_buf, rq->content_len, 0, 0, 0);
xmlNode *root_n;
int ret;
if (!doc)
Expand Down
2 changes: 1 addition & 1 deletion src/normalize_record.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ normalize_record_t normalize_record_create(struct conf_service *service,

if (embed)
{
xmlDoc *xsp_doc = xmlParseMemory(spec, strlen(spec));
xmlDoc *xsp_doc = xmlReadMemory(spec, strlen(spec), 0, 0, 0);

if (!xsp_doc)
no_errors++;
Expand Down
9 changes: 2 additions & 7 deletions src/pazpar2_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -805,7 +805,7 @@ static struct conf_service *service_create_static(struct conf_server *server,
xmlBufferPtr buf = xmlBufferCreate();
xmlNodeDump(buf, node->doc, node, 0, 0);
service->xml_node =
nmem_strdupn(service->nmem, (const char *) buf->content, buf->use);
nmem_strdupn(service->nmem, (const char *) xmlBufferContent(buf), xmlBufferLength(buf));
xmlBufferFree(buf);
}
return service;
Expand Down Expand Up @@ -1289,18 +1289,13 @@ static int parse_config(struct conf_config *config, xmlNode *root)

struct conf_config *config_create(const char *fname)
{
xmlDoc *doc = xmlReadFile(fname,
NULL,
XML_PARSE_XINCLUDE
+ XML_PARSE_NSCLEAN + XML_PARSE_NONET);
xmlDoc *doc = xmlReadFile(fname, 0, XML_PARSE_XINCLUDE + XML_PARSE_NSCLEAN + XML_PARSE_DTDLOAD);
xmlNode *n;
const char *p;
int r;
NMEM nmem = nmem_create();
struct conf_config *config = nmem_malloc(nmem, sizeof(struct conf_config));

xmlSubstituteEntitiesDefault(1);
xmlLoadExtDtdDefaultValue = 1;
if (!doc)
{
yaz_log(YLOG_FATAL, "Failed to read %s", fname);
Expand Down
7 changes: 3 additions & 4 deletions src/session.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ const char *session_lookup_id_facet(struct session *s, struct client *cl,
{
char *retval = 0;
struct facet_id *t = s->facet_id_list;
for (; t; t = t->next)
for (; t; t = t->next)
{
if (!strcmp(client_get_id(cl), t->client_id) && !strcmp(t->type, type) )
{
Expand Down Expand Up @@ -301,8 +301,7 @@ static xmlDoc *record_to_xml(struct session *se,
struct database *db = sdb->database;
xmlDoc *rdoc = 0;

rdoc = xmlParseMemory(rec, strlen(rec));

rdoc = xmlReadMemory(rec, strlen(rec), 0, 0, XML_PARSE_NSCLEAN + XML_PARSE_DTDLOAD);
if (!rdoc)
{
session_log(se, YLOG_WARN, "Non-wellformed XML");
Expand Down Expand Up @@ -1704,7 +1703,7 @@ static int get_mergekey_from_doc(xmlDoc *doc, xmlNode *root, const char *name,
return no_found;
}

static const char *get_mergekey(xmlDoc *doc, xmlNode *root,
static const char *get_mergekey(xmlDoc *doc, xmlNode *root,
struct client *cl, int record_no,
struct conf_service *service, NMEM nmem,
const char *session_mergekey)
Expand Down
2 changes: 1 addition & 1 deletion src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int isdir(const char *path)
yaz_log(YLOG_FATAL|YLOG_ERRNO, "stat %s", path);
exit(1);
}
return st.st_mode & S_IFDIR;
return S_ISDIR(st.st_mode);
}

// Read settings from an XML file, calling handler function for each setting
Expand Down