From: Fabian Keil Date: Wed, 16 Apr 2008 16:38:21 +0000 (+0000) Subject: Don't pass the whole csp structure to flush_socket() X-Git-Tag: v_3_0_9~153 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=d52001f4635fd28608fd8a311d6b200e4663ecfa Don't pass the whole csp structure to flush_socket() when it only needs a file descriptor and a buffer. --- diff --git a/jcc.c b/jcc.c index 61ee70a1..8f408e8c 100644 --- a/jcc.c +++ b/jcc.c @@ -1,4 +1,4 @@ -const char jcc_rcs[] = "$Id: jcc.c,v 1.170 2008/03/06 16:33:46 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 $ @@ -33,6 +33,9 @@ const char jcc_rcs[] = "$Id: jcc.c,v 1.170 2008/03/06 16:33:46 fabiankeil Exp $" * * 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. * @@ -2299,7 +2302,7 @@ static void chat(struct client_state *csp) */ 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); @@ -2573,7 +2576,7 @@ static void chat(struct client_state *csp) 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"); @@ -2701,7 +2704,7 @@ static void chat(struct client_state *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"); diff --git a/parsers.c b/parsers.c index 5ff9eea9..10033023 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.122 2008/03/28 15:13:39 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.123 2008/03/29 12:13:46 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -44,6 +44,9 @@ const char parsers_rcs[] = "$Id: parsers.c,v 1.122 2008/03/28 15:13:39 fabiankei * * Revisions : * $Log: parsers.c,v $ + * Revision 1.123 2008/03/29 12:13:46 fabiankeil + * Remove send-wafer and send-vanilla-wafer actions. + * * Revision 1.122 2008/03/28 15:13:39 fabiankeil * Remove inspect-jpegs action. * @@ -936,7 +939,7 @@ const add_header_func_ptr add_server_headers[] = { * * Parameters : * 1 : fd = file descriptor of the socket to read - * 2 : csp = Current client state (buffers, headers, etc...) + * 2 : iob = The I/O buffer to flush, usually csp->iob. * * Returns : On success, the number of bytes written are returned (zero * indicates nothing was written). On error, -1 is returned, @@ -946,9 +949,8 @@ const add_header_func_ptr add_server_headers[] = { * file, the results are not portable. * *********************************************************************/ -int flush_socket(jb_socket fd, struct client_state *csp) +int flush_socket(jb_socket fd, struct iob *iob) { - struct iob *iob = csp->iob; int len = iob->eod - iob->cur; if (len <= 0) diff --git a/parsers.h b/parsers.h index 301f3a53..0ddccf8a 100644 --- a/parsers.h +++ b/parsers.h @@ -1,6 +1,6 @@ #ifndef PARSERS_H_INCLUDED #define PARSERS_H_INCLUDED -#define PARSERS_H_VERSION "$Id: parsers.h,v 1.39 2007/06/01 16:31:55 fabiankeil Exp $" +#define PARSERS_H_VERSION "$Id: parsers.h,v 1.40 2007/08/11 14:47:26 fabiankeil Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.h,v $ @@ -43,6 +43,10 @@ * * Revisions : * $Log: parsers.h,v $ + * Revision 1.40 2007/08/11 14:47:26 fabiankeil + * Remove the prototypes for functions that are only + * used in parsers.c and thus should be static. + * * Revision 1.39 2007/06/01 16:31:55 fabiankeil * Change sed() to return a jb_err in preparation for forward-override{}. * @@ -257,7 +261,7 @@ extern const struct parsers server_patterns_light[]; extern const add_header_func_ptr add_client_headers[]; extern const add_header_func_ptr add_server_headers[]; -extern int flush_socket(jb_socket fd, struct client_state *csp); +extern int flush_socket(jb_socket fd, struct iob *iob); extern jb_err add_to_iob(struct client_state *csp, char *buf, int n); extern jb_err decompress_iob(struct client_state *csp); extern char *get_header(struct client_state *csp);