-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathChangeLog
More file actions
2163 lines (1526 loc) · 75.8 KB
/
ChangeLog
File metadata and controls
2163 lines (1526 loc) · 75.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
2004-08-10 Robert James Kaes <rjkaes@users.sourceforge.net>
Released tinyproxy 1.6.3 (2004-08-10)
* src/daemon.c (makedaemon): Close the standard file descriptors
when compiling a production executable. I only need these left
open when doing debugging.
2004-08-06 Robert James Kaes <rjkaes@users.sourceforge.net>
* src/conns.c, src/conns.h, src/reqs.c, src/tinyproxy.h:
[Fixes Bug 996518]
Merged in a patch from Hans-Dieter that fixes a problem with upstream
proxy support.
2004-06-14 Robert James Kaes <rjkaes@users.sourceforge.net>
* src/child.h (child_configure): Change the "val" type to a
signed integer.
* src/child.c: Changed the fields in the child_config_s structure
to use regular signed integers since the servers_waiting variable
is signed and therefore, all the tests must use signed arithmetic.
2003-11-19 Robert James Kaes <rjkaes@users.sourceforge.net>
* src/reqs.c (upstream_add): Fixed a spelling mistake with
"Nonsence"
2003-10-17 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.6.2 (2003-10-17)
* Makefile.am:
Removed a redundant "mkdir" command, since the $(mkinstalldirs)
command handles it correctly.
2003-10-16 Robert James Kaes <rjkaes@flarenet.com>
* src/filter.c (filter_init):
Fixed up the comment handling code. Closes bug 822226
[https://sourceforge.net/tracker/index.php?func=detail&aid=822226&group_id=2632&atid=102632]
2003-08-06 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.6.1 (2003-08-06)
* heap.c (debugging_realloc):
Remove the assert on the ptr being NULL since a NULL pointer is
allowed by the realloc() spec.
* child.c (child_main):
Fixed an off-by-one error with the maxrequestsperchild
variable. [Fix proposed by Yannick Koehler]
2003-07-14 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.6.0 (2003-07-14)
* src/htmlerror.c (indicate_http_error):
Added calls to va_end() before leaving the function.
2003-06-26 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (upstream_add):
Rewrote the function to actually handle the various types of
upstream configurations correctly. Hopefully, the code is also a
little clearer in it's implementation.
* src/scanner.l:
Modified the patterns to allow the new upstream directives to work
as defined in the tinyproxy.conf documentation.
* src/heap.c (debugging_free):
Rather than assert on a NULL pointer, log the NULL pointer and
return.
2003-06-25 Robert James Kaes <rjkaes@flarenet.com>
* src/common.h:
Added a test to define INADDR_NONE if it's not present. For
example, SunOS (solaris 2.8) does not include this define. [Thank
to Ben Hartshorne for pointing this out.]
* doc/report.sh.tmpl:
Changed the calls to "ps" and "grep" to use a more portable
syntax.
2003-06-20 Robert James Kaes <rjkaes@flarenet.com>
* doc/tinyproxy.conf, src/grammar.y, src/reqs.c, src/scanner.l, src/tinyproxy.h:
Removed the "ViaHeader" directive and replaced it with the
"ViaProxyName" directive. The "Via" HTTP header is _required_ by
the HTTP spec, so the code has been changed to always send the
header. However, including the proxy's host name could be
considered a security threat, so the "ViaProxyName" directive is
used to set the token sent in the "Via" header. If the directive
is not enabled the proxy's host name will be used.
2003-06-06 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (connect_to_upstream):
Fixed an off-by-one error in the snprintf() call used to build the
URL for the upstream proxy. [Patch suggested by David T. Pierso]
2003-06-02 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac:
Remove the -O2 optimization if debugging is enabled. Also, remove
the -g option if the code does _not_ have debugging enabled.
* doc/tinyproxy.conf:
Included additional examples of how to configure the upstream
proxy support for more selective proxying.
* src/reqs.c, src/tinyproxy.h: (upstream_get):
(upstream_add): Added support to allow ip addresses and networks
to be used when matching an upstream proxy directive.
[Code by Peter da Silva]
2003-05-31 Robert James Kaes <rjkaes@flarenet.com>
* src/heap.h:
Changed the safefree() macro to make it safe to use a conditional
statement, and also safe to use with a rvalue that has a side
effect. [Bug fix recommended by Peter da Silva]
2003-05-30 Robert James Kaes <rjkaes@flarenet.com>
* src/vector.c, src/vector.h (vector_getentry):
Changed the API to return the data pointer and have the length
returned in a argument variable pointer. This should be a more
natural way of using the function.
2003-05-29 Robert James Kaes <rjkaes@flarenet.com>
* src/vector.c, src/vector.h (vector_append):
Renamed the vector_insert() function to more accurately indicate
that entries are appended to the end of the vector.
* doc/tinyproxy.conf, src/grammar.y, src/reqs.c, src/reqs.h, src/tinyproxy.h:
Improved the upstream proxy support by making the upstream proxy
server configurable based on the destination host. [Code written by
Peter da Silva]
2003-05-10 Robert James Kaes <rjkaes@flarenet.com>
* Makefile.am:
Added support for installing the HTML error files used by tinyproxy.
2003-05-05 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (establish_http_connection):
If the port being requested is not a standard HTTP port (80 or
443) append the port string to the host header; otherwise, leave
the host string with only the host's domain name.
Replaced all occurrences of constant 80 and 443 with defines
HTTP_PORT and HTTP_PORT_SSL.
2003-05-04 Robert James Kaes <rjkaes@flarenet.com>
* src/conns.c, src/conns.h:
Fixed a bug that would kill a child process because of an invalid
safefree() call. Basically, destroy_conn() was trying to free
memory not allocated by malloc. [Fix by David T. Pierson]
2003-04-16 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (build_url):
Rebuild the URL from the component pieces. This function
is used by the transparent proxy code. [Anatole Shaw]
(process_request): Fixed up the transparent proxy code so that
filtering can be done on the whole URL. [Anatole Shaw]
(pull_client_data): Added a bug fix for Internet Explorer (IE).
IE will leave an extra CR and LF after the data in an HTTP POST.
The new code will eat the extra bytes if they're present. Thanks
to Yannick Koehler for finding the bug and offering an explanation
as to why it was happening.
Changed all calls of connptr->remote_content_length to
connptr->content_length.server
* src/conns.c, src/conns.h:
Removed the remote_content_length field in the "conn" structure
and replaced it with a smaller structure containing both the
remote/server and the local/client content-length fields if
they're present in the HTTP response headers.
2003-04-01 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac:
Reorganized some of the code, and remove some function tests for
which results were never used, and removed duplicate header tests.
* src/htmlerror.c (add_error_variable):
Test whether connptr->error_variable is NULL, and if so call
safemalloc(). This is needed since saferealloc() will assert() if
the first argument is a NULL pointer.
2003-03-26 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (establish_http_connection):
Always include the port number for the requested server. This
fixes a problem when the server is not listening on the default
port, 80. [Fix suggested by duncan@sapio.co.uk]
2003-03-17 Robert James Kaes <rjkaes@flarenet.com>
* doc/Makefile.am:
Create the doc/report.sh script from the new template file.
* doc/report.sh, doc/report.sh.tmpl:
Moved the doc/report.sh script to doc/report.sh.tmpl file. The
script is then updated by the make procedure to reflect the
correct location of the tinyproxy executable.
2003-03-14 Robert James Kaes <rjkaes@flarenet.com>
* src/htmlerror.c:
Made get_html_file() and lookup_variable() static functions since
they are only used with this file.
* src/utils.c (send_http_message):
Changed the function to use the new http_message API.
2003-03-13 Robert James Kaes <rjkaes@flarenet.com>
* src/grammar.y, src/scanner.l:
Allow the URL for the statistic page to be controlled from the
configuration file, rather than being hard-coded in the program.
[John M Wright]
* doc/tinyproxy.conf:
Include example information for the new "file" directives
(ErrorFile, DefaultErrorFile, StatFile.) [Steven Young]
* src/utils.c, src/utils.h:
Moved the send_http_error_message() and indicate_http_error()
functions into the htmlerror.c file, and recoded them to use the
new variable substitution system. [Steven Young]
* src/common.h:
Fixed up the include order for the <sys/time.h> and <time.h>
headers.
* src/http_message.c, src/http_message.h:
An API to handle HTTP messages as concrete entities.
* src/text.c, src/text.h (chomp):
Fixed up the code to prevent negative array access. Added
code to make sure the supplied arguments are valid.
2003-03-09 Steven Young <sdyoung@well.com>
* src/htmlerror.[ch]: Code to allow the use of substituted
variables in .html files for error reporting instead of
hard-coded HTML documents that use snprintf() for variable
substitution.
* src/stats.c: Changed showstats to use the HTML variable
functions when possible. It still retains the hard-coded
page for when an HTML file is not available.
* src/reqs.c: Changed calls to indicate_http_error() to
use the new HTML variable mechanism.
* src/tinyproxy.h: Added variables to config structure
to keep track of the files to be displayed for various
HTTP errors and the stats page.
* src/conns.h: Added variables to keep track of the
variables to be substituted in .html files displayed
to that client.
* src/grammar.y, src/scanner.l: Added parser support
for the error file configuration keywords
(ErrorFile, DefaultErrorFile, StatFile)
2003-03-08 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.5.3 (2003-03-10)
Added the files required for creating tinyproxy RPMs for Redhat based
systems. (See packaging/redhat)
2003-02-26 Robert James Kaes <rjkaes@flarenet.com>
* src/tinyproxy.c (main):
Removed duplicate code calling the filter_destroy() function.
Once is enough. [Detected by John M Wright]
2003-01-27 Robert James Kaes <rjkaes@flarenet.com>
* src/tinyproxy.c (display_usage):
Removed the output line mentioning that regular expression support
was included. It will be there always.
* src/reqs.c (connect_to_upstream):
Reorganized the preprocessor directives to make sure the
function's symbol name is stored, even if upstream was not
compiled it. This should keep some compilers from reporting
errors.
* doc/tinyproxy.conf, src/filter.c, src/grammar.y, src/scanner.l,
* src/tinyproxy.h:
Added support for conditionally using case sensitive filtering
files. Code changes from James E. Flemer.
* configure.ac:
Moved the AH_TEMPLATE() macro for the GNU regex library to out
from inside an if...fi test. Thanks to James E. Flemer for
supplying a patch.
Bumped up the version number.
* doc/tinyproxy.8:
Changed the default manual section to section 8 (administrator
commands).
* src/reqs.c (process_client_headers):
Fixed inverted anonymous header logic. Fix comes from the FreeBSD
port through James E. Flemer.
2003-01-22 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.5.2 (2003-01-22)
2002-12-04 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (strip_username_password): New function to remove any
username/password part from the host URI.
(extract_http_url), (extract_ssl_url): Use the new
strip_username_password function to remove any non-host
information from the URI.
* src/tinyproxy.c, src/tinyproxy.h, src/utils.c, src/utils.h,
* src/common.h, src/conns.h, src/reqs.c:
Removed the "bool_t" type since it conflicts with the newer C
standards. The type was just replaced by "unsigned int" types.
2002-11-29 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (extract_http_url):
Removed the leading "http://" from all the tests, since it's
skipped by the caller before the URL is passed to this function.
(process_request): Include code to handle proxy FTP requests as
well. This also lead to a bit of a cleanup in the calling
conventions of extract_http_url function. tinyproxy can handle
both types of resources by skipping the leading :// part.
2002-11-26 Robert James Kaes <rjkaes@flarenet.com>
* doc/tinyproxy.conf, src/grammar.y, src/reqs.c, src/scanner.l,
* src/tinyproxy.h:
Included code to disable the sending of the Via header. This is
now controlled by the ViaHeader configure directive.
2002-11-21 Robert James Kaes <rjkaes@flarenet.com>
* src/child.c (child_main):
Cleaned up the notice string to be more clear why a child is being
closed.
* src/tinyproxy.c (main):
Check to see if the PID file was created successfully, and if not
report this to the user and close the program.
* src/utils.c (create_file_safely):
Rather than exiting the program if there is an error, a negative
"error code" is returned to the program. The various callers then
need to decide what to do.
(pidfile_create): Returns an error status depending on whether the
PID file was created successfully.
2002-11-13 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (relay_connection):
Shutdown the client socket for writing once all the data has been
sent.
* src/conns.c (destroy_conn):
Added code to log any error messages when the sockets are closed.
2002-11-05 Robert James Kaes <rjkaes@flarenet.com>
* doc/tinyproxy.conf:
Removed the example for the Tunnel directive since it's been removed.
2002-11-03 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac, src/grammar.y, src/reqs.c, src/scanner.l,
src/tinyproxy.c, src/tinyproxy.h:
Removed all the code supporting the TCP tunnelling feature of
tinyproxy. There is really no need for this code, since there are
perfectly good programs out there (like rinetd) which are designed for
TCP tunnelling. tinyproxy should be a good HTTP proxy, nothing more,
and nothing less; therefore, the tunnelling code is gone.
2002-10-17 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (relay_connection):
Ivan pointed out a bug with the code to send any
remaining data to the server when the connections are being closed.
It was a one line fix.
2002-10-03 Robert James Kaes <rjkaes@flarenet.com>
* src/tinyproxy.c:
Fixed up the storing and sending of the internal tinyproxy logs prior
to when the log file is created. Also, the log file is created with
the proper owner permissions.
* src/log.c, src/log.h:
The internal log structure now uses a vector rather than a hash. This
change was required to actually display all the logs in the correct
order. Also, all log lines are stored internally while tinyproxy is
starting. At the appropriate point all the logs are written to the
log file.
* src/filter.c: Filtering is now case insensitive.
* src/child.c (child_main):
Check to make sure memory could be allocated to handle
the child request.
(child_main_loop): Added a call to truncate_log_file() when the log
file is to be rotated.
2002-08-09 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.5.1 (2002-08-09)
2002-07-09 Robert James Kaes <rjkaes@flarenet.com>
* src/utils.c: (create_file_safely):
(pidfile_create): Changed all the error logging to write to
standard error and then exit the program. This will prevent
segmentation fault problems from occurring because the log file
could not be created properly.
* src/heap.c (malloc_shared_memory):
Changed the static character array to include the ".XXXXXX" string
already. This saves one system call when creating a temporary
file name.
2002-07-08 Robert James Kaes <rjkaes@flarenet.com>
* README:
Updated the "Support" section to include a link to the tinyproxy
Bug Tracker system hosted by SourceForge.
2002-07-05 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac:
Removed the -D_REENTRANT C flag since tinyproxy is no longer a
multi-threaded program.
2002-06-27 Robert James Kaes <rjkaes@flarenet.com>
* src/child.c (child_make):
Reset the various signals to the default signal handler so that
the children can be properly destroyed.
2002-06-15 Robert James Kaes <rjkaes@flarenet.com>
* src/log.c (log_message):
Changed the code so that the log is opened, written, and closed
whenever a message is submitted. This allows the log file to be
moved away, for example a rotating the log, and yet still have the
information written to the correct file name by all the children.
* src/tinyproxy.c:
Renamed the "log_rotation_request" boolean to "received_sighup".
(main): Removed the log file creation code because it has been
moved into the log.c file. Also, removed the explicit fclose()
for the log file since it will be close when the program has
exited.
* src/child.c (child_main_loop):
Moved the filter re-initiation code into the loop. This code is
activated whenever the SIGHUP signal is received.
* src/tinyproxy.h:
Removed the "logf" FILE structure from the config structure, and
also renamed the "log_rotation_request" boolean to
"received_sighup".
* src/utils.c, src/utils.h:
Removed the rotate_log_files() function since I'm moving to an
Apache style where the _user_ needs to move the log file
themselves, and tinyproxy will continue to write to the original
name. This allows more flexibility for users to determine their
own log rotation scheme.
2002-06-07 Robert James Kaes <rjkaes@flarenet.com>
* src/filter.c, src/filter.h:
Added code to handle the "FilterDefaultDeny" directive. The
filter_set_default_policy() function is used to select the default
policy (either default allow or default deny) for the filtering
code. Also, the two filtering functions now support the policy
code.
* doc/tinyproxy.conf, src/grammar.y, src/scanner.l:
Added the "FilterDefaultDeny" directive to allow the user to
select whether the default policy of the filter is to allow
everything which isn't denied, or to deny everything which isn't
allowed.
2002-06-06 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c:
A bunch of changes from Petr Lampa that add transparent proxy
support to tinyproxy. The additional code is in
process_request(), but Petr also had to change around some of the
other functions (like process_client_headers and
handle_connection.) Note: Right now this code has not been
tested, but it is believed to work. To enable run ./configure
--enable-transparent-proxy
* src/filter.c (filter_domain):
Removed code which stripped of a port number from the host name.
The "host" variable will _always_ be just the name by the time
filter_domain() is called.
* src/tinyproxy.c (display_usage):
Added a message indicating whether transparent proxy support has
been compiled in.
* configure.ac:
Added the "--enable-transparent-proxy" flag and moved the
AH_TEMPLATE() macros to _outside_ the "if" tests.
* src/grammar.y:
Added a warning message to the Bind directive stating that it will
be ignored if "transparent proxy" has been compiled into
tinyproxy.
* src/log.c (send_stored_logs):
Actually included the code to output the stored logs. Plus, there
was a bug with how I was calling the hashmap_is_end() function.
This has now been fixed.
2002-06-05 Robert James Kaes <rjkaes@flarenet.com>
* doc/Makefile.am:
Added the "filter-howto.txt" file to the distribution.
* doc/filter-howto.txt:
Added a short filtering HOWTO document from Patrick L. McGillan.
* src/child.c (child_main):
Added a DEBUG call to let me know which process has accepted a
connection. This is needed for debugging using "gdb".
* src/heap.c (malloc_shared_memory):
Removed the assert() call for shared_file since it's now a static
variable.
* src/acl.c (acl_string_processing):
Moved the string processing code out of check_acl() and into it's
own function because it now does two (2) tests. If the ACL string
is a complete host name, in other words doesn't start with a
period, than a reverse DNS look-up is done on the host name and
compared to the IP address of the client; otherwise, the normal
text string comparison is done.
(check_acl): Moved the string text out of the function and removed
some logging code by jumping to the "Deny" code at the end of the
function.
2002-05-31 Robert James Kaes <rjkaes@flarenet.com>
* src/utils.c (create_file_safely):
Added the "truncate_file" boolean flag. This is needed since I
use this function for both the log file and the pid file, and they
behave differently when tinyproxy is started.
(pidfile_create): Call create_file_safely() with a TRUE
"truncate_file" flag so that the file is emptied whenever the pid
file is needed.
* src/tinyproxy.c:
The log file is now opened in "append" mode so that you can
restart tinyproxy without losing the log file.
* src/reqs.c (process_server_headers):
Since we're stripping off the carriage return and newline, we need
to add them back on when sending the response header to the
client.
* src/sock.c (getpeer_information):
Fixed a problem retrieving the FQDN of a host because I was
passing in an incorrect parameter to gethostbyaddr(). D'oh.
2002-05-29 Robert James Kaes <rjkaes@flarenet.com>
* src/heap.c (malloc_shared_memory):
Removed the MMAP_ANON and open("/dev/zero") since they are not
portable across a while enough spectrum of machines. Right now
tinyproxy is using a "classic" temporary file method of sharing
memory. This will likely be improved in the future.
* src/child.c, src/stats.c:
Changed the tests on the return value from malloc_shared_memory()
to make tinyproxy more portable, since we can't be certain that
"if (!ret_value)" would actually detect a mmap() error.
* src/reqs.c (add_header_to_connection):
Removed the "double_cgi" boolean, since tinyproxy now ignores all
the headers after a "double CGI" situation has occurred.
(get_all_headers): Instead of dropping duplicate headers when the
"double CGI" situation occurs, tinyproxy will now drop _all_ the
headers from the "inner" HTTP response.
* src/stats.c (init_stats):
Fixed a spelling mistake where the number of bytes being allocated
was incorrect.
2002-05-28 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (add_header_to_connection):
Added a boolean to indicate that a "Double CGI" situation is in
affect. This is needed to solve a problem with some sites (like
cgi.ebay.com) where they are sending two HTTP response lines (and
associated headers) with a response.
(get_all_headers): Detect if a "Double CGI" situation has occurred.
* src/reqs.c (get_all_headers):
Added code to ignore a "response" line in a header. This was
pointed out as being a problem with eBay (cgi.ebay.com)
(process_server_headers): Added code to make skip blank lines
before a response line.
2002-05-27 Robert James Kaes <rjkaes@flarenet.com>
* doc/Makefile.am:
Fixed up a problem where the tinyproxy manual page was not getting
included with the distribution.
* src/reqs.c (process_request):
Changed the filtering code around to handle both domains and URLs.
* src/tinyproxy.h:
Added into the config structure the filter_urls and
filter_extended flags.
* src/tinyproxy.c: Some spelling fixes.
* src/sock.c (opensock):
Changed a comment around to better state what the code is actually
doing.
* src/filter.c, src/filter.h:
Added a copyright for James E. Flemer since these are his changes.
(filter_init): Added code to handle both host and URLs. Also
include code to use extended regular expressions.
(filter_domain): The old filter_url function has been renamed
filter_domain().
(filter_url): This function now actually filters complete URLs.
* doc/tinyproxy.conf, src/grammar.y, src/scanner.l:
Added support for the "FilterURLs" and "FilterExtended" directives.
These directives were submitted by James Flemer for use with the new
filtering code.
* configure.ac: Updated the version number (pre 1)
* src/tinyproxy.c (display_license): Updated the copyright dates
(main): Moved the signals around so that the appropriate signal is
assigned to either the children or just the parrent process.
Updated the copyright on the file.
2002-05-26 Robert James Kaes <rjkaes@flarenet.com>
* doc/tinyproxy.conf: Removed the "DNSserver" directives since
they're no longer needed.
* configure.ac: Removed the pthread related tests and added a test
for the sys/mman.h header (needed for shared memory.)
* src/Makefile.am: Removed the "dnsserver" program all together,
and changed the names of some of the files.
* src/heap.c, src/heap.h: Added the malloc_shared_memory() and
calloc_shared_memory() function to allow the use of shared memory
between all the children.
* src/log.h, src/reqs.c: Spelling changes (from thread to child.)
* src/grammar.y, src/scanner.l: Removed the directives for the old
DNSserver process.
* src/stats.c: The stats structure has been moved into a shared
memory block since it needs to be shared by all the children.
* src/tinyproxy.c: Removed all the code relating to the DNS API as
it's no longer needed with the new pre-forked model.
Updated the copyright dates.
(main): Moved the signals around so that they are assigned to the
appropriate process level: either the parent only, or all
processes.
* src/sock.c: Removed the DNS API calls and replaced them with the
standard gethostbyname() and gethostbyaddr() functions. This is
possible because tinyproxy now uses a standard pre-forked() method.
* src/common.h: Removed the "pthread" related includes.
* src/thread.c, src/thread.h: No longer using a threading model;
so these files have been replaced by the child.c/child.h files,
which use a pre-forked model.
* src/dnsclient.h, src/dnsserver.c, src/dnsclient.c: I didn't like
the DNS co-process design so I changed tinyproxy from a threading
model to a standard pre-forked model. This means I don't need the
DNS co-process files. Gone.
* src/child.c, src/child.h: Changed from using a threading model
to a standard pre-forked model. Therefore the thread.c file has
been removed and this file replaces it. These files are really
just the thread.c and thread.h files with all the threading stuff
replaced with fork() code. Most of the code is identical.
2002-05-24 Robert James Kaes <rjkaes@flarenet.com>
* src/buffer.c, src/conns.c, src/dnsclient.c, src/hashmap.c,
src/reqs.c, src/stats.c, src/text.c, src/thread.c,
src/tinyproxy.c, src/utils.c, src/vector.c: Fixed a tonne of
spelling mistakes.
* src/sock.c: Fixed some spelling mistakes, and removed the
getpeer_ip() and getpeer_string() functions as they've been
replaced by the getpeer_information() function.
2002-05-23 Robert James Kaes <rjkaes@flarenet.com>
* src/dnsserver.c: The DNS resolver for use by the various
tinyproxy threads. The DNS resolver was moved into a separate
function to prevent the blocking problem the 1.4.x and 1.5.0
versions experienced when a DNS query would take a long time to
return. While the query was blocking, other threads could not
establish their own queries, so they all blocked. Not so good.
* src/dnsclient.c: Introduce the new "dnsserver" API. These
functions are the client side access points.
* src/utils.c: Moved most of the code into separate files. The
debugging heap related code is now in heap.c; the text string code
is in text.c; and, the daemon related code is in daemon.c.
* src/tinyproxy.h: Moved all the system header include code into
the "common.h" file.
* src/tinyproxy.c (takesig): Added a signal handler for the
SIGCHLD signals since a child process is spawned to handle the
"dnsserver" process.
(main): Added code to start and stop the "dnsserver" process.
Switched the signal setup function to the new portable
set_signal_handler() function. Include a test to make sure the
two "dnsserver" directives are set.
* src/sock.c (lookup_domain): Rewrote the function to use the new
"dnsserver" API. This removes the need for the pthread mutex.
(getpeer_information): Replaced the two calls to getpeer_ip() and
getpeer_string() with one call to this function. Streamlines the
peer information retrieval.
Moved the safe_write(), safe_read(), readline(), write_message()
functions into a separate file: network.c
* src/reqs.c (process_request): Fixed a spelling mistake.
(add_xtinyproxy_header): The peer information is stored in the
connection, so removed the call to query it again.
(handle_connection): Pass the peer socket's information into the
connection structure for later use.
* src/grammar.y:
* src/scanner.l: Added the "DNSserverLocation" and
"DNSserverSocket" directives as they are required to properly run
the "dnsserver" DNS resolver.
* src/conns.c (initialize_conn): Added the peer's IP
dotted-decimal address and hostname to the connection structure.
It's faster to get the information _once_ and just store it for
later use.
* src/buffer.c (add_to_buffer): Changed the code to make the order
of insertion into the linked list explicit. I'm not sure if this
fixes a bug or not, but clarity is alway nice.
2002-05-13 Robert James Kaes <rjkaes@flarenet.com>
* src/buffer.h: Moved the definition of the buffer_s structure.
Data hiding is a good thing. Also, replaced the BUFFER_SIZE
macro with a buffer_size() function.
* src/vector.c: Added the "tail" pointer to make insertions more
efficient.
* src/hashmap.c (hashmap_insert): Fixed a potential SEGFAULT if
the memory for the new hashmap entry could not be allocated.
(hashmap_remove): Fixed a problem where an entry could have it's
"prev" pointer still pointing at freed memory. Thanks to Justin
Guyett for finding and fixing this problem.
(hashmap_insert): Thanks to Justin Guyett for changing the code to
use a constant time insert. Much cleaner _and_ faster.
2002-05-10 Robert James Kaes <rjkaes@flarenet.com>
* Makefile.am (install-data-local): Fixed up the tinyproxy.conf
test so that the file is only installed if it doesn't already
exist.
2002-05-09 Robert James Kaes <rjkaes@flarenet.com>
Released tinyproxy 1.5.0 (2002-05-09)
2002-05-08 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac: The --with-config option now supports absolute
paths. If an absolute path is given, the full directory path and
file name are extracted into their appropriate parts.
2002-05-07 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (connect_to_tunnel): Removed request logging code in
the tunnel method since it breaks the "tunnel" concept.
2002-05-02 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac: Added code to figure out exactly where to install
the configuration file.
* Makefile.am (install-data-local): Added a new install run to
install the configuration file to the location specified in
DEFAULT_CONF_FILE.
2002-04-28 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (process_client_headers):
(process_server_headers): Added more error checking code and
send HTTP errors back to the client to let them know what is
happening.
(handle_connection): If there was a server error when processing
the headers, send an error back to the client.
2002-04-27 Robert James Kaes <rjkaes@flarenet.com>
* src/thread.c (thread_pool_create): Set the thread's status
_before_ the thread is created. Thanks to Hans-Georg Bork for
solving this problem.
(thread_main): Fixed up the status setting code. Removed
duplicated code and explicitly set the status when needed.
Fixed up all the code checking the return value from the pthread
functions. These functions return 0 if OK, but a _positive_ error
code.
2002-04-26 Robert James Kaes <rjkaes@flarenet.com>
* src/thread.c: servers_waiting needs to be signed, since it can
go below 0 without causing a problem, but if it wraps around all
hell can break loose.
* src/reqs.c (connect_to_tunnel): Changed the len type to an
signed integer so that we can detect error conditions. Thanks to
Tom Cross for pointing out this problem.
* src/log.c (send_stored_logs): Check the return value of
hashmap_first() since it could be -1, indicating an empty hashmap.
* src/reqs.c (process_client_headers):
(process_server_headers): Test the return value of hashmap_first()
since the hashmap could be empty (returning a -1 via hashmap_first.)
2002-04-25 Robert James Kaes <rjkaes@flarenet.com>
* src/reqs.c (remove_connection_headers): Handle both the
Connection header _and_ the Proxy-Connection header.
(free_request_struct): Check to see if request->path is actually
allocated before trying to delete it.
* src/hashmap.c: The hashmap will now handle multiple keys with
the same value. This change was need because some sites like
Yahoo will send out multiple "Set-Cookie" lines. The
hashmap_keys() function has been removed and has been replaced
with the iterator concept. Also, a few of the functions have had
either their arguments changed, or their return type. Read the
comments in the header file for more information.
2002-04-22 Robert James Kaes <rjkaes@flarenet.com>
* src/thread.c: Renamed the LOCKing macros and added debugging
asserts to them. Also, moved the mutex initialization into the
thread_pool_create() function since I would like to use an error
checking mutex, but my machine doesn't seem to work with it. I
left the code there in case I can get it to work later.
* src/log.c (send_stored_logs): Added this function since the
log_message() function will now stored the messages if the config
file has not been processed yet. This function is called from
within main() to output the messages to the log file _after_ it's
been initialized.
* src/reqs.c (process_client_headers): Added the
"Proxy-Connection" header to the list of client headers we don't
forward to the remote machine.
Added the the "Bind" directive. This is used to indicate which IP
address in a multi-homed machine you would like tinyproxy to bind
out-going connections to. This complements the "Listen" directive
for incoming connections.
2002-04-18 Robert James Kaes <rjkaes@flarenet.com>
* src/sock.c (lookup_domain): Removed the call to inet_aton()
since the gethostbyname() will handle the dotted-decimal case
anyway.
* src/reqs.c: Added a new show_stats field in the conn_s structure
so that we will process the client's headers properly before
trying to send a HTTP response back.
* src/sock.c (getpeer_string): Removed the hstrerror() call since
it's not supported on all machines, and it's not really needed
anyway.
* src/vector.c:
* src/hashmap.c: Changed all calls to malloc, calloc, free, and
strdup to the appropriate safe variety.
(hashmap_delete): Fixed a memory leak where the maps were not
being freed properly.
* src/utils.c (debugging_strdup): Added this function to be used
by the safestrdup() macro to replace all the calls to strdup().
This should allow better tracking of the memory usage.
Also, all the debugging_* functions have had asserts added to them
to hopefully improve the quality of the code.
* src/reqs.c (get_all_headers): Fixed a memory leak since I was
not freeing the header variable, even though the hashmap makes a
copy of it. Thanks to Petr Lampa for finding this one.
* src/tinyproxy.c (takesig): Moved the filter_destroy() code out
of the signal handler and placed it inside of main(). Same
reasoning as the rotate_log_files() changes below.
* src/utils.c (rotate_log_files): Moved the log rotation code out
of the signal handler and into it's own function. Also improved
the robustness of the code. Credit to Petr Lampa for suggesting
that system calls in a signal handler is bad magic. Now the
signal handler sets a flag which is responded to inside of
thread_main_loop().
2002-04-17 Robert James Kaes <rjkaes@flarenet.com>
* configure.ac: Added test for pthread_cancel() since it doesn't
seem to be available on every platform, even if the rest of
pthread is. Thanks to Daniel Flemming and Petr Lampa for
reporting this problem.
* src/sock.c (lookup_domain): Removed the LOOKUP_LOCK() and
LOOKUP_UNLOCK() macros and replaced them with calls the LOCK() and
UNLOCK(). The reason for this change is that I can not be sure
that calls to gethostbyname() and gethostbyaddr() will not
over-write the same static block of memory. Potential problem
pointed out by Petr Lampa.
* src/reqs.c (handle_connection): If the initialize_conn()
function fails, we need to close the socket.
* src/acl.c (check_acl): Changed the code to accept the peer IP
address and string address from the calling function (in this case
handle_connection.)
* src/thread.c (thread_main): Removed close(connfd) since it has
already been closed from within handle_connection(). Thanks to
Petr Lampa for spotting this.
(thread_pool_create): Added test to make sure pthread_create()
succeeds, and returns -1 if all the threads could not be created.
(thread_main_loop): Added test to determine if the
pthread_create() call succeeded. Warns the admin if there was a
problem, but tinyproxy will continue to run.
2002-04-15 Robert James Kaes <rjkaes@flarenet.com>
* src/anonymous.c (anonymous_insert): Now returns -1 upon error,
and 0 upon success. This simplified the code, since I don't care
whether the success is from a successful insert, or because the
string was already present in the hashmap.
(anonymous_search): The function now returns a positive number
greater than zero if the string was found, otherwise zero or a
negative value is returned. Needed to change the _one_ call to
this function to use the new return method.