X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fhttp.c;h=05198d653b03e432458a1f4ff8e2b6c5e4580632;hb=b6c78d80b41b2944279f6c62f777a0d1e44164db;hp=ee427fbd884ab7527d85cbeb8e4c9dcd93643730;hpb=7d0d04af0ae9a019adf0ee16248b5e9c8ea21922;p=pazpar2-moved-to-github.git diff --git a/src/http.c b/src/http.c index ee427fb..05198d6 100644 --- a/src/http.c +++ b/src/http.c @@ -1,5 +1,5 @@ /* This file is part of Pazpar2. - Copyright (C) 2006-2009 Index Data + Copyright (C) 2006-2010 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 @@ -62,21 +62,23 @@ typedef int socklen_t; #include #include -#include "util.h" -#include "eventl.h" #include "pazpar2.h" #include "http.h" -#include "http_command.h" #define MAX_HTTP_HEADER 4096 +#ifdef WIN32 +#define strncasecmp _strnicmp +#define strcasecmp _stricmp +#endif + static void proxy_io(IOCHAN i, int event); static struct http_channel *http_create(const char *addr, struct conf_server *server); static void http_destroy(IOCHAN i); -static struct http_buf *http_buf_freelist = 0; -static struct http_channel *http_channel_freelist = 0; +static struct http_buf *http_buf_freelist = 0; /* thread pr */ +static struct http_channel *http_channel_freelist = 0; /* thread pr */ struct http_channel_observer_s { void *data; @@ -87,8 +89,8 @@ struct http_channel_observer_s { }; -static const char *http_lookup_header(struct http_header *header, - const char *name) +const char *http_lookup_header(struct http_header *header, + const char *name) { for (; header; header = header->next) if (!strcasecmp(name, header->name)) @@ -268,7 +270,7 @@ void http_addheader(struct http_response *r, const char *name, const char *value r->headers = h; } -char *http_argbyname(struct http_request *r, char *name) +const char *http_argbyname(struct http_request *r, const char *name) { struct http_argument *p; if (!name) @@ -279,7 +281,7 @@ char *http_argbyname(struct http_request *r, char *name) return 0; } -char *http_headerbyname(struct http_header *h, char *name) +const char *http_headerbyname(struct http_header *h, const char *name) { for (; h; h = h->next) if (!strcmp(h->name, name))