Filled in a function comment.
[privoxy.git] / doc / changes.txt
1 This file contains details of the changes made to JunkBuster, in
2 chronological order.  Scroll down to the bottom for the newest 
3 additions!
4
5
6 *****************************************************************************
7 * Copied from old README                                                    *
8 *****************************************************************************
9
10 README for the Internet Junkbuster Proxy (TM) Copyright 1997-8 Junkbusters Corp.
11
12    Id: README,v 1.1 2001/04/16 21:10:38 rodney Exp 
13
14    This program is free software; you can redistribute it and/or modify it
15    under the terms of the GNU General Public License as published by the
16    Free Software Foundation; either version 2 of the License,
17    or (at your option) any later version.
18
19    This program is distributed in the hope that it will be useful,
20    but WITHOUT ANY WARRANTY; without even the implied warranty of
21    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22    See the GNU General Public License for more details.
23
24    You should have received a copy of the GNU General Public License
25    along with this program; if not, write to the Free Software
26    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
27
28 The version of the code with this makefile is Version 2.0.2.
29 No CHANGES file is included here; for a history of previous versions see
30    http://www.junkbusters.com/ht/en/ijbdist.html#previous
31 This version tightens security over 2.0.1; some multi-user sites will need
32 to change the listen-address in the configuration file (see previous URL).
33
34 For installation on Windows see http://www.junkbusters.com/ht/en/ijbwin.html
35 An executable is provided so you don't need nmake or a C compiler.
36
37 For UNIX and other systems see the FAQ. If you just want to test it with its
38 defaults of simply stopping cookies and private info, all you need to do now
39 on most Unix systems is type make, run junkbuster & and configure your browser.
40
41 This directory should contain the following files.  The .html files are also
42 in http://www.junkbusters.com/ht/en/ and http://internet.junkbuster.com
43 You are welcome to publish copies of the .html files on your local web server,
44 according to the GNU General Public License.
45
46 gpl.html GNU General Public Licence
47 junkbstr.exe   Executable (binary) for Windows 95/NT
48 Makefile A very bland Makefile; Most versions of Unix except HP & Suns
49       compile without change. Windows requires the changes indicated.
50 ijbman.html Manual for the Internet Junkbuster, HTML format
51 junkbuster.1   Manual for the Internet Junkbuster, man macro format:
52          man ./junkbuster.1 # or nroff -man junkbuster.1 | more
53 ijbfaq.html FAQ: Frequently Asked Questions on the Internet Junkbuster
54       Includes installation instructions
55 junkbstr.ini   Sample configuration file with almost all options commented out
56 sblock.ini  Sample blockfile (which doesn't really block much, see FAQ)
57 scookie.ini Sample cookiefile (permits little; you decide who to trust)
58 saclfile.ini   Sample access control file (block access to everyone)
59 sforward.ini   Sample forwardfile (does no fowarding, no gateways, so SOCKS)
60 strust.ini  Sample trustfile (has no trusted sites and blocks nothing)
61 conn.c, bind.c, encode.c, loaders.c, parsers.c, ssplit.c   Various utilities
62 socks4.c Code for SOCKS4 and SOCKS4A gateways
63 jcc.c    The main program
64 jcc.h    #included declarations etc
65 gnu_regex.c, gnu_regex.h:  Regular expression code from the FSF, not us.
66 win32.c     A few lines of code specific to the Windows version (95 & NT)
67 acl.c    Access controls (new in version 2.0) - doesn't replace firewalls
68 filters.c   Strings for the presentation of messages to user
69
70 If you find that the Internet Junkbuster improves the quality of your life
71 online, we hope you'll visit http://www.junkbusters.com to see how our free
72 services can help you bust other kinds of junk out of your life:
73 junk mail, spam, telemarketing, and invasions of your private data.
74 And please tell your friends about this free product, and help them set it up.
75
76 If your company finds this software useful in protecting its confidential
77 information and making its people happier and more productive, please consider
78 purchasing one of our our commercial support packages:
79    http://www.junkbusters.com/ht/en/ijbfaq.html#commercial
80
81 We don't advertise, so please tell others in your community about us.
82
83 Junkbusters Corp.    http://www.junkbusters.com
84
85
86 *****************************************************************************
87 * Copied from old README.too                                                *
88 *****************************************************************************
89
90 Id: README.TOO,v 1.1 2001/04/16 21:10:38 rodney Exp
91
92 This is the README.TOO file for Stefan's version of the Internet
93 Junkbuster (from http://www.waldherr.org/junkbuster/).
94
95
96
97 Installation:
98 -------------
99 Install the RPM with the usual command `rpm -Uvh foobar.rpm'. Since we
100 run the Junkbuster as user `nobody', cd to a directory where `nobody'
101 has read access (in particular NOT /root) and issue (as root)
102
103    /etc/rc.d/init.d/junkbuster start
104
105 This will be done automagically for you any time you boot your machine.
106
107
108
109 Configuration:
110 --------------
111 To let Junkbuster take `care' of the ads, you have to setup your
112 browser to use the Junkbuster.
113
114   Short instructions for the advanced user:
115
116    Configure Netscape to use 127.0.0.1 on port 8000 as 
117         a proxy server.
118
119   Detailed instructions for the beginner:
120
121         Remove Internet Explorer and install Netscape. No `real' 
122         user would ever use MSIE. Though the Junkbuster works 
123         with IE as well. Read 
124         http://www.junkbusters.com/ht/en/ijbfaq.html#browser
125
126 Check to see if the Junkbuster works correctly by surfing to
127
128    http://127.0.0.1/show-proxy-args
129
130 or any other place and add the text `/show-proxy-args' to the URL.
131 Ok? Then enjoy your ad-free surfing.
132
133
134
135 Mailinglists:
136 -------------
137 In case you are interested in the Junkbuster, there are two
138 mailinglists (junkbuster-users and junkbuster-announce). Instructions
139 on how to subscribe and unsubscribe are at
140
141    http://www.waldherr.org/junkbuster/
142
143 Bugs:
144 -----
145 Please fill out
146
147    http://sourceforge.net/bugs/?func=addbug&group_id=11118
148
149 Patches:
150 --------
151 Please fill out
152
153    http://sourceforge.net/patch/?func=addpatch&group_id=11118
154
155 Need Help?
156 ----------
157 Please fill out
158
159    http://sourceforge.net/support/?func=addsupport&group_id=11118
160
161
162 Comments:
163 ---------
164 I would greatly appreciate feedback for this program. Send comments to
165 Stefan Waldherr <stefan@waldherr.org> (in either German or English). I
166 prefer plain text. If you happen to see an ad which got thru the filter
167 PLEASE use the `contribute' form at http://www.waldherr.org/junkbuster/.
168
169 Have fun,
170 Stefan.
171
172
173 *****************************************************************************
174 * Copied from old README.win                                                *
175 *****************************************************************************
176
177 $Id: README.WIN,v 1.1 2001/04/16 21:10:38 rodney Exp $
178
179 This is the README.WIN file for the Windows version of the Internet
180 Junkbuster (from http://www.waldherr.org/junkbuster/).
181
182 Installation:
183 -------------
184 Congrats, since you are reading this file, you have already unzipped
185 the archive correctly.
186
187 Start the Junkbuster with `junkbstr' (i.e., click on the icon in the
188 ijb subdirectory). If you want to start Junkbuster automatically,
189 make a link to the program in the `Autostart' folder.
190
191
192
193 Configuration:
194 --------------
195 To let Junkbuster take `care' of the ads, you have to setup your
196 browser to use the Junkbuster.
197
198   Short instructions for the advanced user:
199
200    Configure Netscape to use 127.0.0.1 on port 8000 as 
201         a proxy server.
202
203   Detailed instructions for the beginner:
204
205         Remove Internet Explorer and install Netscape. No `real' 
206         user would ever use MSIE. Though the Junkbuster works 
207         with IE as well. Read 
208         http://www.junkbusters.com/ht/en/ijbfaq.html#browser
209
210 Check to see if the Junkbuster works correctly by surfing to
211
212    http://127.0.0.1/show-proxy-args
213
214 or any other place and add the text `/show-proxy-args' to the URL.
215 Ok? Then enjoy your ad-free surfing.
216
217
218
219 Mailinglists:
220 -------------
221 In case you are interested in the Junkbuster, there are two
222 mailinglists (junkbuster-users and junkbuster-announce). Instructions
223 on how to subscribe and unsubscribe are at
224
225    http://www.waldherr.org/junkbuster/
226
227 Bugs:
228 -----
229 Please fill out
230
231    http://sourceforge.net/bugs/?func=addbug&group_id=11118
232
233 Patches:
234 --------
235 Please fill out
236
237    http://sourceforge.net/patch/?func=addpatch&group_id=11118
238
239 Need Help?
240 ----------
241 Please fill out
242
243    http://sourceforge.net/support/?func=addsupport&group_id=11118
244
245 Comments:
246 ---------
247 I would greatly appreciate feedback for this program. Send comments to
248 Stefan Waldherr <stefan@waldherr.org> (in either German or English). I
249 prefer plain text. If you happen to see an ad which got thru the filter
250 PLEASE use the `contribute' form at http://www.waldherr.org/junkbuster/.
251
252 Have fun,
253 Stefan.
254
255
256 *****************************************************************************
257 * Copied from old README.re_filter                                          *
258 *****************************************************************************
259
260 DISCLAIMER:
261    This is pre-alpha code. Using it in any other way
262    than just reading it is a high risk activity and
263    the author disclaims all liability for any damage.
264
265    See the GNU General Public License at
266    http://www.gnu.org/copyleft/gpl.html for details.
267
268
269 Dear alpha-Tester,
270
271 Thank you for trying out the experimental re_filter feature of
272 Junkbuster. As this is still a very early pre-release version,
273 and I'm neither much of an autoconf or make wizard, building
274 the patched junkbuster involves some manual work, that is 
275 described below. Please also see the Request for Thoughts section,
276 as the whole point of this pre-release ist to collect ideas for
277 improvement and bug reports.
278
279
280 INSTALLATION:
281
282   - Get and install pcre from
283     ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/
284     Version 3.1 or any later one will do. I recommend 3.4.
285     It *should* install on Win32 as well, but I haven't tried
286     that. Don't forget to run ldconfig afterwards.
287
288   - Now you have two options:
289
290     A) Install pcrs as a shared library:
291        pcrs.c and pcrs.h are included in the (patched) ijb subdirectory.
292        1.) patch Makefile < Makefile.re_shared.diff  
293        2.) gcc -Wall -fPIC -c pcrs.c  
294        3.) gcc -shared -Wl,-soname,libpcrs.so.1 -o libpcrs.so.1.0.1 pcrs.o -lc -lpcre
295        If this worked OK,
296        4.) copy libpcrs.so.1.0.1 to /usr/local/lib
297        5.) ln -s /usr/local/lib/libpcrs.1.0.1 /usr/local/lib/libpcrs.so
298        6.) ldconfig (Or whatever the equivalent on your platform might be)
299        7.) cp pcrs.h /usr/local/include
300
301     OR
302
303     B) Incorporate pcrs into the junkbuster (much easier):
304        Smile and relax. You're done.
305
306   - Edit the provided re_filterfile to suit your needs and place it
307     with the rest of junkbusters configfiles.
308
309   - Now junkbuster should build with a simple 'make'.
310     Note: Setting debug = REF in jcc.c will enable debugging
311     for the re_filter.
312
313   - Include a line "re_filterfile <wherever>" in your junkbuster
314     config file, pointing at the re_filterfile
315
316   - (Optional:) Include a line "re_filter_all" in the config
317     file. This will set the Policy to filter content from all sites.
318     Default is to filter only from sites that you wouldn't send a
319     cookie either. 
320
321   - Fire up junkbuster.
322
323 HOW IT WORKS:
324
325     Nah, not tonight anymore ;-)
326
327 REQUEST FOR THOUGHTS:
328
329   - The main decision is whether to filter on-the-fly or to buffer
330     up the whole document and then run the filter on it. I've built
331     both versions and currently prefer buffering.
332
333     The advantage of on-the-fly-filtering is obviously that the
334     document begins to display before it's fully loaded. The big
335     disadvantage is that with arbitraty content altering in place,
336     you don't know the size that the document will have after
337     altering when the Content-Length Header is to be sent. Only
338     option is to chew it altogether.
339
340     Apart from preserving the ability to generate a valid Content-Length
341     header (which the patch currently does not yet do), buffering up
342     the document has some advantages from the filtering point of view:
343
344      - Reliability. Patterns in the document cannot be ripped apart
345        and are reliably found. (If you look at the document fragment-wise
346        while it's being transmitted, you miss any pattern that spans
347        a fragment border) This is especially bad for patterns that do
348        serious HTML reformatting, as fragments are typically in the order
349        of 1500 bytes each.
350
351      - Flexibility: The re_filter gives you the choice whether you want
352        to replace only the pattern's first occurance or replace it globally.
353        This becomes meningless with fragments. (Solution possible, though.)
354
355     As the filter only processes objects of MIME type text/*, which are typically
356     rather small compared to binary multimedia (sic) type data, I don't think
357     that the disadvantage of delayed display of the first bytes is really grave.
358
359     What do you think?
360
361   - Is the choice between a radical (filter all) and semi-smart (filter only when
362     also crunching cookies) flexible enough? Should I really introduce yet another
363     configfile for specifying the domains to filter content from? Would anyone use
364     that?
365
366   - Should I use pcre as a shared library and work out a nice installation
367     automagic, or should the relevant functions be incorporated in re_filter.c?
368
369   - Even if yes, do we really want an extension that relies on an external library
370     like pcre?
371
372   - Any bugs, stupid parts in the code ?
373
374   - Cool suggestions for the re_filterfile? (PLEASE!)
375
376   - Should character set translation along the lines of Perl's 'tr' operator
377     be included?
378
379   - Is the whole feature just pathetic?
380
381 FEEDBACK:
382
383     A whole lot of work has gone into this feature (the pcrs code was also
384     just written for this) and I'd really like to know if and how you like
385     it. Since I'm more of a perl than C programmer (and after doing so much
386     string manipulation in C I'm once again glad abaout that!), I'm sure there
387     is much to improve. Please send any suggestions/observations/hellos to
388     oes@paradis.rhein.de. I would also be very glad about any assistance for
389     a autoconf/make procedure for prcs.
390
391 Well, have fun!
392 --Andreas
393
394
395 *****************************************************************************
396 * Copied from old README.cygwin                                             *
397 *****************************************************************************
398
399 Id: README.cygwin,v 1.2 2001/04/29 23:16:29 rodney Exp
400
401
402 What I did:  I saw too many "personalities" in IJB; so I
403 ran the code through a couple of regexp's and then let XEmacs
404 reformat the whole shebang!  The results is a uniform
405 looking code base; aka. as if 1 person created the whole
406 project.
407
408 Why I did it:  (1) it is easier to maintain  (2) easier for
409 a new person to make changes/additions  (3) it *looks* more
410 professional  (4) IMHO, it is easier to read (this is very
411 much a personal preference).
412
413 What I propose: A IJB standards list be included in the
414 distro and all source/patch checkins be checked for
415 compliance.  We don't need to be an arse on this point, but
416 submitters should make a valiant attempt to support the
417 standards.
418
419 Note: do not even try to diff my code with another code
420 base, you will be overwhelmed.  After all, the regexps did a
421 good bit of changing and XEmacs reformatter did a great deal
422 more.
423
424 One more note: these changes include conditional compilation for
425 un?x (namely Linux), cygwin (un?x like compile for WIN32), and
426 mingw32 (WIN32 like compilation w/o VC++).  Right now, all seems
427 fully functional except cygwin.  The cygwin compile will work,
428 but includes code to make it single threaded.  I need to debug
429 the fork issues, but that will have to come later.
430
431
432 Specific changes to expect:
433
434
435 1: I've majorly reworked the Makefiles.  The existing Makefile was
436 too *spaghetti* for me!  For one, I eliminated the "-I." from the
437 include path (ugly).  Use #include "" for local directory files
438 and #include <> for path found files (that's basic even to c).
439
440
441 2: In accordance with #1, I changed #include "windows.h" to
442 #include <windows.h> and #include <gnu_regex.h> to #include
443 "gnu_regex.h".
444
445
446 3: As part of my standards suggestions (to come later in this
447 file), I added a standard comment block to every function.  There
448 were too many functions with *no* comment and about 20 different
449 styles to those that did.  This is an example of the block I used:
450 /*********************************************************************
451  *
452  * Function    :  block_acl
453  *
454  * Description :  Block this request?
455  *                Decide yes or no based on ACL file.
456  *
457  * Parameters  :
458  *          1  :  src = Address the browser/user agent is requesting.
459  *          2  :  dst = The proxy or gateway address this is going to.
460  *          3  :  csp = Current client state (buffers, headers, etc...)
461  *
462  * Returns     : 0 = FALSE (don't block) and 1 = TRUE (do block)
463  *
464  *********************************************************************/
465
466
467 4: Some files prototyped like this:
468       void
469       func(param1)
470       int param1;
471       {
472       }
473 and other like this:
474       void func(int param1)
475       {
476       }
477 I made all look like the second.
478
479
480 5: Made:
481       if(  to be  if (
482       while(  to be  while (
483       switch(  to be switch (
484       etc ...
485 The former looks too much like a function call.
486
487
488 6: Put braces on their own line and aligned under the
489 reserved word:
490       if () {
491       } else {
492       }
493 to be:
494       if ()
495       {
496       }
497       else
498       {
499       }
500 The same for while, do, etc...
501
502
503 7: Casted malloc in several places, e.g.:
504       p = malloc(n);
505 to be:
506       p = (char *)malloc(n);
507 This eliminates compiler warnings.
508
509
510 8: Applied the Perl regexp patch and made it fully conditionally
511 compiled (-DPCRS=TRUE).
512
513
514 9: It *appears* that if MINGW32 sees a "main" function, it will
515 try to link it and start with main (ala console mode).  Since I
516 need MINGW32 to find WinMain instead, I conditionally changed
517 "main" to "_main" (for MINGW32 only!).
518
519
520 10: Changed popup.c to be killpopup.c.  This was necessary to
521 clean up the Makefile.  Since there was an ini type file called
522 "popup" and "popup.c", make got confused on target names.  No
523 other ini file has a .c file with the same name, so I hope this
524 isn't a big deal.  Plus, it fits its config variable
525 (kill_all_popups) much better.
526
527
528 11: Added:
529   /*
530     Local Variables:
531     tab-width: 3
532     end:
533   */
534 to all .c and .h files.  I use 3 character tabs and this will make
535 the files display correctly in Emacs editors.  This is just my
536 default setting.  Perhaps I will filter all files via "expand
537 -t3", so not to pi$$ everyone off.  Vi is capable of using 3
538 character tabs, as I am sure VC++ would be.
539
540
541 12: Several places included regexp code with out "#ifdef REGEX"
542 which broke the ability to compile w/o regexp's.  I fixed the code
543 and can compile w/o regexp (which I don't normally do, but now I
544 *can*).
545
546
547 13: In WinMain, changed:
548       pszLastTok = strchr(pszLastTok, ' ');
549 to be:
550       pszLastTok = strchr(pszLastTok+1, ' ');
551 The former causes an infinite loop with 2 or more parameters.
552
553
554 14: Added my own strdup for Cygwin, see jcc.c for why.
555
556
557 15: Added defines in the Makefile and this to jcc.h:
558       #define VERSION VERSION_MAJOR "." VERSION_MINOR "." VERSION_POINT
559 This makes "update the numbers also in jcc.h manually" unnecessary
560 (see your Makefile for this quote).
561
562
563 16: Split the "inifiles" target in Makefile into separate targets,
564 this way each file can be regenerated individually according to
565 the same implicit rule.
566
567
568 17: With the Makefile restructure, I can only provide for
569 Cygwin/gcc.  Hopefully this is a bit cleaner and others can add
570 their compilers w/o re-spaghetting the file.  I have provided
571 several makefiles as examples only, I do not intend for the
572 project to start maintaining multiple Makefiles.  Perhaps some of
573 the platform specific Makefile code could be split out into
574 separate files and we could use the "include" directive to read in
575 the correct one.
576
577 Better than this, let's get a configure.in guru on the project and
578 dynamically create the Makefiles!
579
580
581 18: In an effort to get this to market (you knew this was coming
582 eh?), I am going to put the standards suggestions in another file
583 and ship this one as is.  But then, you can probably guess most of
584 the standards by the changes you see.
585
586
587 19: Added a really quick and dirty "install" target to the
588 Makefile.  This needs to be cleaned up and proper directories put
589 in for each platform.
590
591
592 -- release 1 (obsoleted) --
593
594
595 20: Incorporated the TOGGLE and webDAV support patches into my
596 Cygwin patch.  I added conditional compilation to both features.
597 I changed "extern BOOL g_bToggleIJB;" to be of type "int".  This
598 makes jcc.h independent of "windows.h".  The inclusion of such
599 should not (and is not) necessary for compilation on all
600 platforms.  Besides, BOOL is really only a char or an int anyway!
601
602
603 21: Added a new ini!  I modified the usual un?x type config file
604 to M$ type ini file for a Perl regexp compile.  This was necessary
605 to call EditFile on the Perl regexp config file.  The new ini
606 filename is "sregexp.ini" (naturally).  I then added menu items to
607 edit the popup.ini and sregexp.ini files.
608
609
610 22: I made "dot h" files for all the "dot c" files.  I used this
611 command to do the *dirty* work:
612     grep -e "^[A-z]" *.c | sed -e "/=/d" -e "/^[^(]*$/d" \
613          -e "/^extern/d" -e "/^static/d" -e "/;$/d"
614
615 And I made each "dot h" file be immune to multiple inclusion via
616 conditional compilation.  Ie. the "jcc.h" file will only include
617 itself if _JCC_H is undefined.
618
619 After this was done, I compiled the project source by source and
620 let the compiler tell me what each file was dependent on.  Once I
621 got all the objects to compile, I included the new dependencies in
622 the Makefiles.
623
624 BTW, I intend to get the Makefile to be generated by a configure
625 script.  Whether this is a GNU "configure.in" type file or a shell
626 script, I do not know.  All I do know is that this is a must for a
627 "Go/No go" type decision.  We cannot proceed with the philosophy
628 "leave it up to the user to get it to work".
629
630
631 23: I broke out the code to load the config file from main.  I put
632 this code into a function called load_config.  I made this routine
633 be called from a signal "HUP".  This means we can restart
634 junkbusters from the command line or from the daemon script via
635 "restart" without actually killing it and restarting it.  This is
636 common behavior to un?x daemons (see inetd for example).  I fixed
637 the junkbusters.init script to take advantage of this.  I intend
638 to make a M$ menu complement to this as soon as I can.
639
640
641 24: BTW, if you have not already noticed by my postings and/or
642 code, I have added patches and made them all conditionally
643 compiled.  Ie. #ifdef TOGGLE, #ifdef WEBDAV, #ifdef PCRS, etc...
644 I think that all extensions to IJB should be submitted in this
645 way.  Not only can you compile IJB to be as "tight" as you want,
646 it also gives the user a "smorgasbord" of options to
647 choose from.  This is quite common in the free software world (you
648 need look no farther than emacs to see this) and provides maximum
649 flexibility.
650
651
652 25: As promised, I obsoleted the "ijbw32.ini" file.  I was a bit
653 confused by the "close-behaviour=1" entry.  It seems to me that it
654 duplicated the "close-button-minimizes=1" entry.  And (by looking
655 at the code) it was unused.  Anyway, I eliminated the "ijbw32.ini"
656 file and assimilated the settings into the config file.  Bye Bye
657 "ijbw32.ini", hello "config" (aka. don't unnecessarily duplicate
658 files and/or data types).
659
660
661 26: Eliminated re_filter.c.  This only defined
662 (un)load_re_filterfile and re_process_buffer.  I moved
663 (un)load_re_filterfile to loaders.c and re_process_buffer to
664 filters.c. I also modified the Makefiles to reflect this.  In the
665 doing, I modified the loader and unloader to use the "files"
666 variable and moved joblist to "re_filterfile_spec" struct.  I
667 added "plist" to the client_state so that all Perl regexp code
668 could find the latest parsing of the re_filterfile ini.
669
670 This is in keeping with the IJB data structures philosophies.
671
672
673 27: Eliminated acl.c.  This (as pcre) only defined
674 (un)load_aclfile and block_acl.  I moved (un)load_aclfile to
675 loaders.c and block_acl to filters.c.  I also modified the
676 Makefiles to reflect this.
677
678
679 28: Since I created "dot h" files for all the "dot c" files, I
680 eliminated all the "extern ...variable;" and all the "extern
681 ...function;" statements that I could find in the "dot c" files.
682 Instead, I included the proper "dot h" files to do this for us.
683
684
685 29: Corrected the "install" Makefile target for un?x.  I will do
686 the same for WIN32 targets.
687
688
689 30: Note on the "TOGGLE" patch: since I made IJB fully restartable
690 via a NOHUP signal; I thought the TOGGLE patch should apply to
691 both un?x and WIN32.  Thus, I eliminated the WIN32 dependencies in
692 that patch and added "toggle" to the config file.  Now everything
693 works fine for either platform.  Still to come is a restart menu
694 command in WIN32 (See: note 23).
695
696
697 31: Just a possible programmer note, we REALLY need a generic
698 linked list module.  Since text lists, client states, filter
699 files, etc... implement list creation and destruction over and
700 over; I suggest a generic list that can handle *any* type of list
701 (ala template classes in C++).  If this module included an
702 iterator (of sorts), we could eliminate the myriad of "for ( top=x;
703 NULL != x->next; x=x->next )" type statements that are all over
704 IJB.
705
706 After all, this was taught in the basic "Intro to Data Types"
707 class (for all you CS majors).
708
709
710 32: Renamed all of the .INI files to be .TXT files.  I did this
711 because the .INI files were NOT *really* ini files; which
712 potentially be confusing.  I used the .TXT extension to make sure
713 that EditFile still worked.
714
715
716 33: Removed the "initialed comments", such as "/* swa */".  This
717 leads to less readable code (because it becomes fragmented) and
718 retains the "multiple personality" syndrome.  Comments such as
719 this can always be figured out from the versioning system.  Also,
720 these comments really should be pooled in one place : the README
721 files.
722
723
724 34: Perhaps we should break with the current versioning tactic of 
725 a "tail version" and start fresh.  Perhaps a new major version
726 release is in order?  Version = 3.0.0?
727
728
729 35: Added a "Accept-Encoding: gzip" cruncher.  If a stream is
730 compressed via gzip (Netscape specific I think), then it cannot
731 be modified with Perl regexps.  So I added this as an option in
732 the Makefiles.
733
734
735 36: As promised in one of my postings, I have make a
736 configure-esk script to generate the Makefiles.  I would still
737 like to have a full blown configure.in compatible system, but this 
738 will do in the meantime.  Note: this configure script covers
739 linux, cygwin, and mingw32.  At this point I do not have VC++ to
740 test any of my changes.  But the configure script should be
741 flexible enough to handle this platform.
742
743
744 --
745
746 Please give any feedback to the ijb egroups and, if you feel you
747 need quicker contact, CC me at IwantToKeepAnon@yahoo.com
748
749 Let me say once more, this has a *lot* of changes and may (aka
750 WILL) break a lot of existing patches.  But I hope the "idea" will
751 catch on.  Perhaps this could be made the baseline code base and
752 other patches added and standardized later.
753
754 *****************************************************************************
755 * Date:        7 May 2001                                                   *
756 * Version:     ??                                                           *
757 * Description: Changes for MS Visual C++                                    *
758 * Author:      Jon Foster <jon@jon-foster.co.uk>                            *
759 *****************************************************************************
760 (Based on Stromlund's version 0.20)
761
762 I have made several changes to make this compile under VC++ 97, and add new
763 features.
764
765 Code changes:
766
767 1) If you disable IJB (using the TOGGLE patch) it now turns PCRS off.
768 2) "Missing function prototype" warnings have been corrected by adding
769    appropriate #include statements
770 3) The _DIST_URL define removed and hardcoded.  There are hardcoded URLs all 
771    over the place that need fixing - one more doesn't matter.  We do really 
772    need to come up with a long-term solution though.  (Suggestion: Host a 
773    redirector on the SourceForge web space.  e.g 
774    "http://ijbswa.sourceforge.net/redirect.php?ver=2.0.2-10&target=faq",
775    "http://ijbswa.sourceforge.net/redirect.php?ver=2.0.2-10&target=download",
776    etc.  This allows us to move the pages around easily, and the SourceForge
777    space can be maintained by anyone who's interested, it's not tied to a 
778    particular individual.  This is similar to the approach taken by 
779    Microsoft and Netscape in their browsers.)
780 4) New file ijbconfig.h is #included everywhere.  This provides me with a
781    place to define VERSION, PCRS, etc.  You can still define VERSION_xxx
782    on the command line, but the other defines are in the header file.
783    There were just too many #defines - so many that the VC++ 97 IDE 
784    broke when I tried to define them on the command line.  We probably 
785    should fix the configure script so that it modifies this file.
786 5) Deleted empty file afxres.h - we needed to use the VC++ system header 
787    file of that name.  However, it's easier to just delete it and put 
788    the relevent #defines in w32res.h.
789 6) New #define: NO_PROGRAM_NAME_DISPLAY uses "IJB" as the program name in 
790    the log file instead of "H:\Documents and Settings\Administrator\My 
791    Documents\Prog\VC\ijb2\Release\junkbuter.exe" or similar.  The reason 
792    for this should be obvious!
793 7) New #define: STATISTICS enables the statistics feature
794 8) Statistics is thread-safe, I think.  However, loading up the
795    statistics page now counts as a blocked request.
796 9) New, shorter message if a setting in the config file is recognised 
797    but unsupported by the current build.  It doesn't have "WARNING:" in
798    front of it either.  We may want to actually take this message out 
799    and have it just silently ignore these entries.
800 10) New feature: #define SPLIT_PROXY_ARGS and the show-proxy-settings 
801     page will split each file out to a seperate page.  This is 
802     because the files are quite big, and having to do 1 extra click to 
803     get to them is no problem.  This #define also disables the 
804     suppress_blocklists feature (because I believe the original intent 
805     of suppress_blocklists was similar?).  It also saves memory by 
806     reading the config files to generate the HTML on the fly, rather 
807     than storing prepared HTML constantly in memory.
808 11) Marked global constants with "const" attribute.  This has a 
809     knock-on effect on pointers in function prototypes, so these have
810     also been marked const where needed.
811 12) Rewrote encode.c to have tables pre-initialized, so it can be 
812     marked constant.  Also split into 3 distinct functions so that
813     the tables (which are realy an implementation detail) are not
814     visible outside that file.
815 13) Changes to how files are reloaded when you reload the config 
816     file.  Previous method didn't free memory (or if you uncommented 
817     the free() calls, it was not thread-safe.)  It is now handled 
818     automatically - files are reloaded whenever the filename to 
819     read changes, or the file's timestamp changes.  The code in
820     loaders.c which handles this test has been moved to a single
821     utility function.
822 14) killpopup changes:
823      * Only compiled if you #define KILLPOPUPS
824      * Call to filter_popups() moved from read_socket() to chat().
825      * Writing 1 past end of buffer bug fixed.
826      * It was scanning the whole buffer even if only partially filled.
827      * Moved load/unload to loaders.c and changed file handling to 
828        follow standard.
829 15) Auto-detect whether we want an image or HTML implemented for 
830     Microsoft IE.  :-)
831     There doesn't seem to be a way to tell with the latest build 
832     of Mozilla. :-(
833 16) Image file code conditionally compiled.
834 17) Provided option (SPLIT_PROXY_ARGS) to split the show-proxy-args
835     page into a main page, and then a page for each config file.  
836     This option will also save memory by loading the files when 
837     required for display, rather than saving them in memory when
838     they are initially loaded.
839 18) Force page loading ("noijb.") patch applied.  #define FORCE_LOAD
840
841
842 Packaging changes:
843
844 1) PCRE 3.4 (less it's test and demo programs) is now included in the 
845    pcre directory.  It will be statically linked with Junkbuster.  (On 
846    win32, DLLs cause a lot of hassle - with a library this small it isn't 
847    worth it.  I don't know if it would be better to dynamically link under
848    UNIX?)
849 2) junkbustr.dsp and junkbustr.dsw VC++97 project and workspace files are
850    included.
851 3) win32build/junkbustr.exe Win32 binary is included.  It should not require
852    any DLLs.  It was compiled with all features supported.
853 4) All README.xyz files put together in this file.
854 5) Unused files (acl.c, pthread.c, ...) deleted.
855 6) My block & cookie files used (based on the Waldherr ones).
856
857 Known bug: The Adobe Acrobat 4 plug-in fails when I try to view PDF files in
858 MSIE.  Workaround: disable "web browser integration" in the Adobe Acrobat 
859 settings.
860
861 *****************************************************************************
862 * Date:        14 May 2001 (early morning)                                  *
863 * Version:     Reported as 2.9.0                                            *
864 * Description: Various updates                                              *
865 * Author:      Jon Foster <jon@jon-foster.co.uk>                            *
866 *****************************************************************************
867
868 1)  Now use PCRE, not GNU REGEX.  I have not yet had chance to check the
869     syntax of the block/image/cookie file to ensure that they match what
870     is expected - however they seem to work.
871 2)  Replaced "configure" script with one generated by "autoconf".  Also 
872     use a header "config.h" (was ijbconfig.h in my previous release) for 
873     the #defines.  "config.h" is now generated with "autoheader" from 
874     "acconfig.h" and "configure.in".  (Note that to install you do not
875     need autoconf or autoheader - just run "./configure".)
876     To see command-line options, run "./configure --help".
877     This is my first ever autoconf script, so it has some rough edges
878     (how PCRE is handled is the roughest).
879 3)  Error logging code replaced with new module errlog.c, based on the
880     one from JunkBusterMT (but with the threading code removed).
881 4)  Most of Rodney's 0.21 and 0.21A patches applied. (Marked *).  I did not
882     apply all of these, since I had already independently done conditional
883     popup file, conditional image file, and integration of popup code.
884 5*) ACL, Jar and trust files conditionally compiled.
885 6*) New source file headers.
886 7*) Various cosmetic changes.  (But I have not consistently ordered the 
887     config files - I think that's worthwhile, but it's 1am and I want to
888     get this released!)
889 8*) RCS tags on .h files.
890 9)  RCS tags are const char[] rather than const char *.  (Saves 4 bytes
891     per tag ;-)
892 10) VC++ project files renamed to vc_junkbuster.*.
893 11) show-proxy-args now shows status of all conditionals, not just REGEX
894 12) Various functions moved around.  Most notably all the system-specific
895     sockets code which was spread between jcc.c, bind.c, and connect.c,
896     has been moved to "jbsockets.c".  The non-system-specific code from
897     connect.c and socks4.c has been movet to "gateway.c".  Also, the
898     config file loader and the global variables it writes to have been
899     moved to "loadcfg.c".  (Maybe this should go into loaders.c?)
900     And candidate for the "worst filename ever" award is "miscutil.c",
901     which contains, well, miscellaneous utility functions like zalloc.
902     (Suggestions for a better name for this file are welcome!)
903 13) Loaders now use a common function to read a line and skip comments,
904     and this function also stores the proxy_args.
905 14) Added ./junkbuster --help     (Not for Win32 GUI)
906 15) Added ./junkbuster --version  (Not for Win32 GUI)
907 16) Win32 resources are now all marked as "U.S. English", rather than
908     being a mix of "U.S. English", "U.K. English" and "Irish English".
909 17) Version number changes to 2.9.0
910
911 Known bugs:
912 - See (1) above about blockfiles.
913 - Sending SIGHUP (under Red Hat Linux 7.1) causes a crash.  v0.21A hangs
914   after a SIGHUP.  This needs investigating, but pthreads support will 
915   almost certainly help here, so it may not be worth investigating
916   immediately.
917 - Compiling with shared system pcre and pcreposix libraries is supported
918   via a switch to configure, but completely untested.
919
920 Please note that there are now 2^14 == 16384 combinations of conditional 
921 defines, and 4 major compilers (VC, Linux, mingw32, cygwin) for a total 
922 of 65536 different builds.  We cannot possibly test all of them!  My 
923 standard build is "everything on", and I've tested that on each compiler,
924 along with a few variants.  You may uncover new bugs (probably compiler 
925 errors) if you use an exotic combination of switches.
926
927 *****************************************************************************
928 * Date:        14 May 2001                                                  *
929 * Version:     2.9.1                                                        *
930 * Description: Various updates                                              *
931 * Author:      Andreas S. Oesterhelt <oes@oesterhelt.org>                   *
932 *****************************************************************************
933 (From his e-mail:)
934
935  - in parsers.c, fixed two #ifdef FORCE to #ifdef FORCE_LOAD
936    (BTW: I think FORCE is precise enough, since loading remote
937    data is the whole purpose of a proxy..)
938  - Set the FORCE_PREFIX (back) to 'IJB-FORCE-LOAD-'. While 'noijb.'
939    is more elegant and looks like a hostname in the URL, it doesn't
940    make clear to the inexperienced user that the proxy is bypassed. It
941    also has a higher name collision risk.
942  - Filled in the function header templates for my functions in
943    parsers.c (again). They obviously got lost in our current
944    patch war ;-)
945  - Cut the credit for the §-referrer-option from the config file,
946    that Stefan had placed there.
947  - Improved the re_filterfile 
948
949 *****************************************************************************
950 * Date:        14 May 2001                                                  *
951 * Version:     2.9.2                                                        *
952 * Description: FORCE patch (again!)                                         *
953 * Author:      Andreas S. Oesterhelt <oes@oesterhelt.org>                   *
954 *****************************************************************************
955 (These notes written by Jon)
956
957 - Andreas applied the latest version of the FORCE patch.
958
959 *****************************************************************************
960 * Date:        14 May 2001 (late afternoon)                                 *
961 * Version:     2.9.3                                                        *
962 * Description: Various updates                                              *
963 * Author:      Jon Foster <jon@jon-foster.co.uk>                            *
964 *****************************************************************************
965
966 1) Incorporated updates from current CVS tree, including:
967    - Amiga support (completely untested by me - I don't have an Amiga)
968    - "tinygif 3" support (redirects blocked images to a specified URL, so
969      the browser doesn't have to load and cache many copies of the same
970      image).
971    - one case where there were both local and global "referrer" variables
972      (yuck!) clarified by renaming the local one to "refer".
973    - Fixed some places where close() was used instead of close_socket().
974    Thanks to Jörg Strohmayer (joergs at users.sourceforge.net) for these.
975 2) Temporary hack to get FORCE_LOAD to work with IE.  I just lowercased the
976    FORCE_LOAD_PREFIX.  Needs fixing properly.
977 3) Most URLs hardcoded into JunkBuster were changed to go through a script
978    e.g. http://ijbswa.sourceforge.net/redirect.php?v=2.9.3&to=faq
979    The only other URLs left are the GNU GPL:
980      http://www.fsf.org/copyleft/gpl.html
981    and the home page:
982      http://ijbswa.sourceforge.net/
983    ... and various URLs which will be intercepted by JunkBuster anyway.
984    TODO: Still need to do something with the URLs in JunkBuster Corp's 
985    copyright/trademark notice on the bottom of the show-proxy-args page.
986 4) PCRE or GNU Regex is now a #define option.
987
988 *****************************************************************************
989 * End of file                                                               *
990 *****************************************************************************
991