From: oes <oes@users.sourceforge.net>
Date: Tue, 31 Jul 2001 14:46:00 +0000 (+0000)
Subject: - Persistant connections now suppressed
X-Git-Tag: v_2_9_9~171
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/@default-cgi@/faq/user-manual/static/gitweb.js?a=commitdiff_plain;h=5ca7d385d473ae4aa660ed4590648f395d880f8f;p=privoxy.git
- Persistant connections now suppressed
- sed() no longer appends empty header to csp->headers
---
diff --git a/parsers.c b/parsers.c
index 0f361cbf..decf1dd6 100644
--- a/parsers.c
+++ b/parsers.c
@@ -1,4 +1,4 @@
-const char parsers_rcs[] = "$Id: parsers.c,v 1.19 2001/07/25 17:21:54 oes Exp $";
+const char parsers_rcs[] = "$Id: parsers.c,v 1.20 2001/07/30 22:08:36 jongfoster Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/parsers.c,v $
@@ -41,6 +41,12 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.19 2001/07/25 17:21:54 oes Exp $"
*
* Revisions :
* $Log: parsers.c,v $
+ * Revision 1.20 2001/07/30 22:08:36 jongfoster
+ * Tidying up #defines:
+ * - All feature #defines are now of the form FEATURE_xxx
+ * - Permanently turned off WIN_GUI_EDIT
+ * - Permanently turned on WEBDAV and SPLIT_PROXY_ARGS
+ *
* Revision 1.19 2001/07/25 17:21:54 oes
* client_uagent now saves copy of User-Agent: header value
*
@@ -250,7 +256,6 @@ const struct parsers client_patterns[] = {
{ "from:", 5, client_from },
{ "cookie:", 7, client_send_cookie },
{ "x-forwarded-for:", 16, client_x_forwarded },
- { "proxy-connection:", 17, crumble },
#ifdef FEATURE_DENY_GZIP
{ "Accept-Encoding: gzip", 21, crumble },
#endif /* def FEATURE_DENY_GZIP */
@@ -261,6 +266,9 @@ const struct parsers client_patterns[] = {
{ "Host:", 5, client_host },
#endif /* def FEATURE_FORCE_LOAD */
/* { "if-modified-since:", 18, crumble }, */
+ { "Keep-Alive:", 11, crumble },
+ { "connection:", 11, crumble },
+ { "proxy-connection:", 17, crumble },
{ NULL, 0, NULL }
};
@@ -278,11 +286,13 @@ void (* const add_client_headers[])(struct client_state *) = {
client_cookie_adder,
client_x_forwarded_adder,
client_xtra_adder,
+ connection_close_adder,
NULL
};
void (* const add_server_headers[])(struct client_state *) = {
+ connection_close_adder,
NULL
};
@@ -495,14 +505,6 @@ char *sed(const struct parsers pats[], void (* const more_headers[])(struct clie
(*f)(csp);
}
- /* add the blank line at the end of the header, if necessary */
- if ( (csp->headers->last == NULL)
- || (csp->headers->last->str == NULL)
- || (*csp->headers->last->str != '\0') )
- {
- enlist(csp->headers, "");
- }
-
hdr = list_to_text(csp->headers);
return(hdr);
@@ -1234,6 +1236,28 @@ void client_x_forwarded_adder(struct client_state *csp)
}
+/*********************************************************************
+ *
+ * Function : connection_close_adder
+ *
+ * Description : Adds a "Connection: close" header to csp->headers
+ * as a temporary fix for the needed but missing HTTP/1.1
+ * support. Called from `sed'.
+ * FIXME: This whole function shouldn't be neccessary!
+ *
+ * Parameters :
+ * 1 : csp = Current client state (buffers, headers, etc...)
+ *
+ * Returns : N/A
+ *
+ *********************************************************************/
+void connection_close_adder(struct client_state *csp)
+{
+ enlist(csp->headers, strdup("Connection: close"));
+
+}
+
+
/*********************************************************************
*
* Function : server_set_cookie