-const char jcc_rcs[] = "$Id: jcc.c,v 1.168 2008/03/02 12:25:25 fabiankeil Exp $";
+const char jcc_rcs[] = "$Id: jcc.c,v 1.171 2008/03/27 18:27:25 fabiankeil Exp $";
/*********************************************************************
*
* File : $Source: /cvsroot/ijbswa/current/jcc.c,v $
* Purpose : Main file. Contains main() method, main loop, and
* the main connection-handling function.
*
- * Copyright : Written by and Copyright (C) 2001-2007 the SourceForge
+ * Copyright : Written by and Copyright (C) 2001-2008 the SourceForge
* Privoxy team. http://www.privoxy.org/
*
* Based on the Internet Junkbuster originally written
*
* Revisions :
* $Log: jcc.c,v $
+ * Revision 1.171 2008/03/27 18:27:25 fabiankeil
+ * Remove kill-popups action.
+ *
+ * Revision 1.170 2008/03/06 16:33:46 fabiankeil
+ * If limit-connect isn't used, don't limit CONNECT requests to port 443.
+ *
+ * Revision 1.169 2008/03/04 18:30:39 fabiankeil
+ * Remove the treat-forbidden-connects-like-blocks action. We now
+ * use the "blocked" page for forbidden CONNECT requests by default.
+ *
* Revision 1.168 2008/03/02 12:25:25 fabiankeil
* Also use shiny new connect_port_is_forbidden() in jcc.c.
*
#include "filters.h"
#include "loaders.h"
#include "parsers.h"
-#include "killpopup.h"
#include "miscutil.h"
#include "errlog.h"
#include "jbsockets.h"
struct http_request *http;
int len; /* for buffer sizes (and negative error codes) */
jb_err err;
-#ifdef FEATURE_KILL_POPUPS
- int block_popups_now = 0; /* bool, 1==currently blocking popups */
-#endif /* def FEATURE_KILL_POPUPS */
/* Function that does the content filtering for the current request */
filter_function_ptr content_filter = NULL;
if (http->ssl && connect_port_is_forbidden(csp))
{
const char *acceptable_connect_ports =
- csp->action->string[ACTION_STRING_LIMIT_CONNECT] ?
- csp->action->string[ACTION_STRING_LIMIT_CONNECT] :
- "443 (implied default)";
+ csp->action->string[ACTION_STRING_LIMIT_CONNECT];
+ assert(NULL != acceptable_connect_ports);
log_error(LOG_LEVEL_INFO, "Request from %s marked for blocking. "
"limit-connect{%s} doesn't allow CONNECT requests to port %d.",
csp->ip_addr_str, acceptable_connect_ports, csp->http->port);
*/
if (write_socket(csp->sfd, hdr, strlen(hdr))
- || (flush_socket(csp->sfd, csp) < 0))
+ || (flush_socket(csp->sfd, csp->iob) < 0))
{
log_error(LOG_LEVEL_CONNECT, "write header to: %s failed: %E",
http->hostport);
*/
buf[len] = '\0';
-#ifdef FEATURE_KILL_POPUPS
- /* Filter the popups on this read. */
- if (block_popups_now)
- {
- filter_popups(buf, csp);
- }
-#endif /* def FEATURE_KILL_POPUPS */
-
/* Normally, this would indicate that we've read
* as much as the server has sent us and we can
* close the client connection. However, Microsoft
hdrlen = strlen(hdr);
if (write_socket(csp->cfd, hdr, hdrlen)
- || ((flushed = flush_socket(csp->cfd, csp)) < 0)
+ || ((flushed = flush_socket(csp->cfd, csp->iob)) < 0)
|| (write_socket(csp->cfd, buf, (size_t)len)))
{
log_error(LOG_LEVEL_CONNECT, "Flush header and buffers to client failed: %E");
if (!http->ssl) /* We talk plaintext */
{
-
-#ifdef FEATURE_KILL_POPUPS
- /* Start blocking popups if appropriate. */
- if ((csp->content_type & CT_TEXT) && /* It's a text / * MIME-Type */
- (csp->action->flags & ACTION_NO_POPUPS) != 0) /* Policy allows */
- {
- block_popups_now = 1;
- /*
- * Filter the part of the body that came in the same read
- * as the last headers:
- */
- filter_popups(csp->iob->cur, csp);
- }
-#endif /* def FEATURE_KILL_POPUPS */
content_filter = get_filter_function(csp);
}
/*
*/
if (write_socket(csp->cfd, hdr, strlen(hdr))
- || ((len = flush_socket(csp->cfd, csp)) < 0))
+ || ((len = flush_socket(csp->cfd, csp->iob)) < 0))
{
log_error(LOG_LEVEL_CONNECT, "write header to client failed: %E");