Add (incomplete) JMeter test plan
[pazpar2-moved-to-github.git] / src / http.c
index ee427fb..05198d6 100644 (file)
@@ -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 <yaz/comstack.h>
 #include <yaz/nmem.h>
 
-#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))