-const char parsers_rcs[] = "$Id: parsers.c,v 1.36 2001/10/13 12:51:51 joergs Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.37 2001/10/23 21:36:02 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
* IJBSWA team. http://ijbswa.sourceforge.net
*
* Based on the Internet Junkbuster originally written
- * by and Copyright (C) 1997 Anonymous Coders and
+ * by and Copyright (C) 1997 Anonymous Coders and
* Junkbusters Corporation. http://www.junkbusters.com
*
- * This program is free software; you can redistribute it
+ * This program 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 Software
* Foundation; either version 2 of the License, or (at
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.37 2001/10/23 21:36:02 jongfoster
+ * Documenting sed()'s error behaviou (doc change only)
+ *
* Revision 1.36 2001/10/13 12:51:51 joergs
* Removed client_host, (was only required for the old 2.0.2-11 http://noijb.
* force-load), instead crumble Host: and add it (again) in client_host_adder
#include <assert.h>
#include <string.h>
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__OS2__)
#include <unistd.h>
#endif
* as an array index. Therefore we need to make sure that high-bit
* characters generate +ve values, and ideally we also want to make
* the argument match the declared parameter type of "int".
- *
- * Why did they write a character function that can't take a simple
+ *
+ * Why did they write a character function that can't take a simple
* "char" argument? Doh!
*/
#define ijb_isupper(__X) isupper((int)(unsigned char)(__X))
/* { "if-modified-since:", 18, crumble }, */
{ "Keep-Alive:", 11, crumble },
{ "connection:", 11, crumble },
- { "proxy-connection:", 17, crumble },
+ { "proxy-connection:", 17, crumble },
{ NULL, 0, NULL }
};
{ "Content-Type:", 13, server_content_type },
{ "Content-Length:", 15, server_content_length },
{ "Content-MD5:", 12, server_content_md5 },
- { "Content-Encoding:", 17, server_content_encoding },
+ { "Content-Encoding:", 17, server_content_encoding },
{ "Transfer-Encoding:", 18, server_transfer_coding },
{ "Keep-Alive:", 11, crumble },
{ NULL, 0, NULL }
client_x_forwarded_adder,
client_xtra_adder,
client_accept_encoding_adder,
- connection_close_adder,
+ connection_close_adder,
NULL
};
void (* const add_server_headers[])(struct client_state *) = {
- connection_close_adder,
+ connection_close_adder,
NULL
};
if (strncmpic(p->str, v->str, v->len) == 0)
{
hdr = v->parser(v, p->str, csp);
- freez((char *)p->str); /* FIXME: Yuck! patching a list...*/
+ freez(p->str); /* FIXME: Yuck! patching a list...*/
p->str = hdr;
}
}
int n;
memset(http, '\0', sizeof(*http));
- http->cmd = strdup(req);
+ http->cmd = strdup(req);
buf = strdup(req);
n = ssplit(buf, " \r\n", v, SZ(v), 1, 1);
*p = '\0';
http->hostport = strdup(url);
}
- /*
+ /*
* Repair broken HTTP requests that don't contain a path
*/
else
csp->content_type = CT_TABOO;
}
- /*
+ /*
* Raise flag if body chunked
*/
if (strstr(s, "chunked"))
csp->flags |= CSP_FLAG_CHUNKED;
/*
- * If the body was modified, it has been
+ * If the body was modified, it has been
* de-chunked first, so adjust the header:
*/
if (csp->flags & CSP_FLAG_MODIFIED)
#ifdef FEATURE_FORCE_LOAD
/* Since the referrer can include the prefix even
* even if the request itself is non-forced, we must
- * clean it unconditionally
+ * clean it unconditionally
*/
strclean(s, FORCE_PREFIX);
#endif /* def FEATURE_FORCE_LOAD */
if (strstr (s, "image/gif"))
{
/* Client will accept HTML. If this seems counterintuitive,
- * blame Microsoft.
+ * blame Microsoft.
*/
csp->accept_types |= ACCEPT_TYPE_MSIE_HTML;
}
char *server_http(const struct parsers *v, const char *s, struct client_state *csp)
{
char *ret = strdup(s);
-
+
sscanf(ret, "HTTP/%*d.%*d %d", &(csp->http->status));
if (csp->http->status == 206)
{
}
-#ifdef FEATURE_FORCE_LOAD
+#ifdef FEATURE_FORCE_LOAD
/*********************************************************************
*
* Function : strclean
*
- * Description : In-Situ-Eliminate all occurances of substring in
+ * Description : In-Situ-Eliminate all occurances of substring in
* string
*
* Parameters :
p = pos + len;
do
{
- *(p - len) = *p;
+ *(p - len) = *p;
}
while (*p++ != '\0');