aboutsummaryrefslogtreecommitdiff
path: root/www/junkbuster
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2000-11-30 02:56:04 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2000-11-30 02:56:04 +0000
commit42a1f9ec9b97f5269ec3a4aafb43233644de2cd8 (patch)
tree72ffd055e254046cffc304ed070e2bddab396fff /www/junkbuster
parent44f5c19e81927fd9704fe416e55364f8317260e6 (diff)
downloadports-42a1f9ec9b97f5269ec3a4aafb43233644de2cd8.tar.gz
ports-42a1f9ec9b97f5269ec3a4aafb43233644de2cd8.zip
Notes
Diffstat (limited to 'www/junkbuster')
-rw-r--r--www/junkbuster/files/junkbuster.sh.in4
-rw-r--r--www/junkbuster/files/patch-jcc.c75
-rw-r--r--www/junkbuster/files/patch-junkbstr.ini11
-rw-r--r--www/junkbuster/files/patch-junkbuster.120
4 files changed, 110 insertions, 0 deletions
diff --git a/www/junkbuster/files/junkbuster.sh.in b/www/junkbuster/files/junkbuster.sh.in
index 9f3e639a9494..e4e4f199ec6f 100644
--- a/www/junkbuster/files/junkbuster.sh.in
+++ b/www/junkbuster/files/junkbuster.sh.in
@@ -10,6 +10,10 @@ start)
stop)
killall junkbuster && echo -n " junkbuster"
;;
+restart)
+ $0 stop
+ $0 start
+ ;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
exit 64
diff --git a/www/junkbuster/files/patch-jcc.c b/www/junkbuster/files/patch-jcc.c
new file mode 100644
index 000000000000..d921d4c01faa
--- /dev/null
+++ b/www/junkbuster/files/patch-jcc.c
@@ -0,0 +1,75 @@
+--- jcc.c.orig Fri Oct 30 22:58:48 1998
++++ jcc.c Sat Mar 11 11:42:32 2000
+@@ -96,9 +96,27 @@
+
+ char DEFAULT_USER_AGENT[] ="User-Agent: Mozilla/3.01Gold (Macintosh; I; 68K)";
+
++char BLANKGIF[] = "HTTP/1.0 200 OK\r\n"
++ "Content-type: image/gif\r\n\r\n"
++ "GIF89a\001\000\001\000\200\000\000\377\377\377\000\000"
++ "\000!\371\004\001\000\000\000\000,\000\000\000\000\001"
++ "\000\001\000\000\002\002D\001\000;";
++
++char JBGIF[] = "HTTP/1.0 200 OK\r\n"
++ "Content-type: image/gif\r\n\r\n"
++ "GIF89aD\000\013\000\360\000\000\000\000\000\377\377\377!"
++ "\371\004\001\000\000\001\000,\000\000\000\000D\000\013\000"
++ "\000\002a\214\217\251\313\355\277\000\200G&K\025\316hC\037"
++ "\200\234\230Y\2309\235S\230\266\206\372J\253<\3131\253\271"
++ "\270\215\342\254\013\203\371\202\264\334P\207\332\020o\266"
++ "N\215I\332=\211\312\3513\266:\026AK)\364\370\365aobr\305"
++ "\372\003S\275\274k2\354\254z\347?\335\274x\306^9\374\276"
++ "\037Q\000\000;";
++
+ int debug = 0;
+ int multi_threaded = 1;
+ int hideConsole = 0;
++int tinygif = 0;
+
+ #ifdef _WIN32
+ #define sleep(N) Sleep(((N) * 1000))
+@@ -198,6 +216,9 @@
+ struct cookie_spec *cs;
+ struct gateway *gw;
+ struct http_request *http;
++ char *my_image_regexp = ".*(\\.gif|\\.jpe?g|\\gif$|\\jpe?g$)";
++ regex_t my_regexp;
++ int errcode;
+
+ http = csp->http;
+
+@@ -328,7 +349,21 @@
+ prog, http->hostport, http->path);
+ }
+
+- write_socket(csp->cfd, p, strlen(p));
++ if (tinygif > 0) {
++ errcode = regcomp(&my_regexp, my_image_regexp,
++ (REG_EXTENDED|REG_NOSUB|REG_ICASE));
++
++ if (regexec( &my_regexp, http->path, 0, NULL, 0) == 0) {
++ if (tinygif == 1)
++ write_socket(csp->cfd, BLANKGIF, sizeof(BLANKGIF)-1);
++ else
++ write_socket(csp->cfd, JBGIF, sizeof(JBGIF)-1);
++ } else {
++ write_socket(csp->cfd, p, strlen(p));
++ }
++ regfree( &my_regexp );
++ } else
++ write_socket(csp->cfd, p, strlen(p));
+
+ if(DEBUG(LOG)) fwrite(p, strlen(p), 1, logfp);
+
+@@ -704,6 +739,11 @@
+
+ if(strcmp(cmd, "debug") == 0) {
+ debug |= atoi(arg);
++ continue;
++ }
++
++ if(strcmp(cmd, "tinygif") == 0) {
++ tinygif = atoi(arg);
+ continue;
+ }
+
diff --git a/www/junkbuster/files/patch-junkbstr.ini b/www/junkbuster/files/patch-junkbstr.ini
new file mode 100644
index 000000000000..11fb5242a4ed
--- /dev/null
+++ b/www/junkbuster/files/patch-junkbstr.ini
@@ -0,0 +1,11 @@
+--- junkbstr.ini.orig Fri Oct 30 22:58:48 1998
++++ junkbstr.ini Sat Mar 11 11:45:45 2000
+@@ -126,3 +126,8 @@
+ # debugging output "in order" for easy reading.
+ #
+ #single-threaded
++
++# tinygif allows you to change the appearance of blocked images
++# tinygif 0 # Show a "broken icon"
++# tinygif 1 # Show a GIF of one transparent pixel
++# tinygif 2 # Show a GIF with the word "JUNKBUSTER"
diff --git a/www/junkbuster/files/patch-junkbuster.1 b/www/junkbuster/files/patch-junkbuster.1
new file mode 100644
index 000000000000..59ae67838fb2
--- /dev/null
+++ b/www/junkbuster/files/patch-junkbuster.1
@@ -0,0 +1,20 @@
+--- junkbuster.1.orig Fri Oct 30 22:58:48 1998
++++ junkbuster.1 Sat Mar 11 11:49:54 2000
+@@ -215,6 +215,17 @@
+ In version 1.3 and later
+ the blockfile and cookiefile are checked for changes before each request.
+ .TP
++tinygif \fIN\fP
++Set appearance of blocked GIFs. You can select one of the following
++values:
++.br
++.br
++\h'-\w"0 = "u'0 = Show a ``broken icon'' in the browser
++.br
++\h'-\w"1 = "u'1 = Show a one pixel transparent GIF
++.br
++\h'-\w"2 = "u'2 = Show a GIF with the word ``JUNKBUSTER'' in it
++.TP
+ .\" anchor: o_w wafer
+ \fI-w NAME=VALUE\fP (Old) wafer \fINAME=VALUE\fP (New)
+ Specifies a pair to be sent as a cookie with every request