-const char parsers_rcs[] = "$Id: parsers.c,v 1.56.2.1 2002/09/25 14:52:45 oes Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.56.2.6 2003/04/14 21:28:30 oes Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/Attic/parsers.c,v $
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.56.2.6 2003/04/14 21:28:30 oes
+ * Completing the previous change
+ *
+ * Revision 1.56.2.5 2003/04/14 12:08:16 oes
+ * Added temporary workaround for bug in PHP < 4.2.3
+ *
+ * Revision 1.56.2.4 2003/03/07 03:41:05 david__schmidt
+ * Wrapping all *_r functions (the non-_r versions of them) with mutex semaphores for OSX. Hopefully this will take care of all of those pesky crash reports.
+ *
+ * Revision 1.56.2.3 2002/11/10 04:20:02 hal9
+ * Fix typo: supressed -> suppressed
+ *
+ * Revision 1.56.2.2 2002/09/25 14:59:53 oes
+ * Improved cookie logging
+ *
* Revision 1.56.2.1 2002/09/25 14:52:45 oes
* Added basic support for OPTIONS and TRACE HTTP methods:
* - New parser function client_max_forwards which decrements
#include <unistd.h>
#endif
+#ifdef OSX_DARWIN
+#include <pthread.h>
+#include "jcc.h"
+/* jcc.h is for mutex semapores only */
+#endif /* def OSX_DARWIN */
#include "project.h"
#include "list.h"
#include "parsers.h"
client_cookie_adder,
client_x_forwarded_adder,
client_xtra_adder,
- client_accept_encoding_adder,
+ /* Temporarily disabled: client_accept_encoding_adder, */
connection_close_adder,
NULL
};
{
if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0)
{
- log_error(LOG_LEVEL_HEADER, "Supressed offer to compress content");
+ log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress content");
freez(*header);
- if (!strcmpic(csp->http->ver, "HTTP/1.1"))
- {
- *header = strdup("Accept-Encoding: identity;q=1.0, *;q=0");
- if (*header == NULL)
- {
- return JB_ERR_MEMORY;
- }
- }
+
+ /* Temporarily disable the correct behaviour to
+ * work around a PHP bug.
+ *
+ * if (!strcmpic(csp->http->ver, "HTTP/1.1"))
+ * {
+ * *header = strdup("Accept-Encoding: identity;q=1.0, *;q=0");
+ * if (*header == NULL)
+ * {
+ * return JB_ERR_MEMORY;
+ * }
+ * }
+ *
+ */
}
return JB_ERR_OK;
if ((csp->action->flags & ACTION_NO_COMPRESSION) != 0)
{
freez(*header);
- log_error(LOG_LEVEL_HEADER, "Supressed offer to compress transfer");
+ log_error(LOG_LEVEL_HEADER, "Suppressed offer to compress transfer");
}
return JB_ERR_OK;
* port information, parse and evaluate the Host
* header field.
*
+ * Also, kill ill-formed HOST: headers as sent by
+ * Apple's iTunes software when used with a proxy.
+ *
* Parameters :
* 1 : csp = Current client state (buffers, headers, etc...)
* 2 : header = On input, pointer to header to modify.
{
char *p, *q;
+ /*
+ * If the header field name is all upper-case, chances are that it's
+ * an ill-formed one from iTunes. BTW, killing innocent headers here is
+ * not a problem -- they are regenerated later.
+ */
+ if ((*header)[1] == 'O')
+ {
+ log_error(LOG_LEVEL_HEADER, "Killed all-caps Host header line: %s", *header);
+ freez(*header);
+ return JB_ERR_OK;
+ }
+
if (!csp->http->hostport || (*csp->http->hostport == '*') ||
*csp->http->hostport == ' ' || *csp->http->hostport == '\0')
{
time (&now);
#ifdef HAVE_LOCALTIME_R
tm_now = *localtime_r(&now, &tm_now);
+#elif OSX_DARWIN
+ pthread_mutex_lock(&localtime_mutex);
+ tm_now = *localtime (&now);
+ pthread_mutex_unlock(&localtime_mutex);
#else
tm_now = *localtime (&now);
#endif