/* This file is part of Pazpar2.
- Copyright (C) 2006-2008 Index Data
+ Copyright (C) 2006-2009 Index Data
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
return 0;
}
-static struct http_buf *http_buf_create()
+static struct http_buf *http_buf_create(void)
{
struct http_buf *r;
while (*cp == ' ')
cp++;
content_len = 0;
- while (*cp && isdigit(*cp))
+ while (*cp && isdigit(*(const unsigned char *)cp))
content_len = content_len*10 + (*cp++ - '0');
if (content_len < 0) /* prevent negative offsets */
content_len = 0;
return 0;
*(value++) = '\0';
h->name = nmem_strdup(c->nmem, p);
- while (isspace(*value))
+ while (isspace(*(const unsigned char *) value))
value++;
if (value >= p2) // Empty header;
{
hp = http_header_append(c, hp,
"X-Pazpar2-Server-Port", server_port);
sprintf(server_via, "1.1 %s:%s (%s/%s)",
- ser->host, server_port, PACKAGE_NAME, PACKAGE_VERSION);
+ ser->host ? ser->host : "@",
+ server_port, PACKAGE_NAME, PACKAGE_VERSION);
hp = http_header_append(c, hp, "Via" , server_via);
hp = http_header_append(c, hp, "X-Forwarded-For", c->addr);
}
/*
* Local variables:
* c-basic-offset: 4
+ * c-file-style: "Stroustrup"
* indent-tabs-mode: nil
* End:
* vim: shiftwidth=4 tabstop=8 expandtab
*/
+