freebsd-ports/www/polipo/files/patch-aa
Renato Botelho 709be1a43a Fixes for www/polipo
1. avoid error message "502 Range without partial content"
2. shutdown polipo on system shutdown

PR:		ports/84167
Submitted by:	Frank Behrens <frank@pinky.sax.de> (maintainer)
2005-07-27 15:21:44 +00:00

103 lines
3.2 KiB
Text

--- Makefile Tue Jun 29 02:07:35 2004
+++ Makefile Mon Dec 27 15:35:40 2004
@@ -2,8 +2,8 @@
BINDIR = $(PREFIX)/bin
MANDIR = $(PREFIX)/man
INFODIR = $(PREFIX)/info
-LOCAL_ROOT = /usr/share/polipo/www
-DISK_CACHE_ROOT = /var/cache/polipo
+LOCAL_ROOT = $(PREFIX)/share/polipo/www
+DISK_CACHE_ROOT ?= /var/cache/polipo
# CDEBUGFLAGS = -O
@@ -47,7 +47,8 @@
DEFINES = $(FILE_DEFINES) $(PLATFORM_DEFINES)
-CFLAGS = $(MD5INCLUDES) $(CDEBUGFLAGS) $(DEFINES) $(EXTRA_DEFINES)
+CFLAGS ?= $(CDEBUGFLAGS)
+CFLAGS += $(MD5INCLUDES) $(DEFINES) $(EXTRA_DEFINES)
SRCS = util.c event.c io.c chunk.c atom.c object.c log.c diskcache.c main.c \
config.c local.c http.c client.c server.c auth.c tunnel.c \
--- config.sample Mon Sep 6 23:31:57 2004
+++ config.sample Mon Dec 27 15:35:40 2004
@@ -65,6 +65,11 @@
# localDocumentRoot = ""
+# Access rights for new cache files.
+diskCacheFilePermissions=0640
+# Access rights for new directories.
+diskCacheDirectoryPermissions=0750
+
### Domain Name System
### ******************
--- forbidden.c Sat Sep 11 00:31:24 2004
+++ forbidden.c Mon Dec 27 15:35:40 2004
@@ -158,8 +158,8 @@
}
if(forbiddenFile == NULL) {
- if(access("/etc/polipo/forbidden", F_OK) >= 0)
- forbiddenFile = internAtom("/etc/polipo/forbidden");
+ if(access("/usr/local/etc/polipo/forbidden", F_OK) >= 0)
+ forbiddenFile = internAtom("/usr/local/etc/polipo/forbidden");
}
if(have_forbiddenDomains) {
--- main.c Tue Oct 5 23:41:49 2004
+++ main.c Mon Dec 27 15:35:40 2004
@@ -106,8 +106,8 @@
}
if(configFile == NULL) {
- if(access("/etc/polipo/config", F_OK) >= 0)
- configFile = internAtom("/etc/polipo/config");
+ if(access("/usr/local/etc/polipo/config", F_OK) >= 0)
+ configFile = internAtom("/usr/local/etc/polipo/config");
if(configFile && access(configFile->string, F_OK) < 0) {
releaseAtom(configFile);
configFile = NULL;
--- polipo.man Tue Jun 29 02:07:35 2004
+++ polipo.man Mon Dec 27 15:35:40 2004
@@ -43,16 +43,16 @@
Change the value of a configuration variable.
.SH FILES
.TP
-.B /etc/polipo/config
+.B /usr/local/etc/polipo/config
The default location of Polipo's configuration file.
.TP
-.B /etc/polipo/forbidden
+.B /usr/local/etc/polipo/forbidden
The default location of the list of forbidden URLs.
.TP
.B /var/cache/polipo/
The default location of the on-disk cache.
.TP
-.B /usr/share/polipo/www/
+.B /usr/local/share/polipo/www/
The default root of the local web space.
.SH SIGNALS
.TP
--- server.c Thu Jan 20 00:21:19 2005
+++ server.c Wed Jul 27 13:24:28 2005
@@ -1783,10 +1783,11 @@
} else if(code < 400 &&
(content_range.from >= 0 || content_range.to >= 0 ||
content_range.full_length >= 0)) {
- do_log(L_ERROR, "Range without partial content.\n");
- httpServerAbort(connection, 1, 502,
- internAtom("Range without partial content"));
- goto fail;
+ do_log(L_WARN, "Range without partial content.\n");
+ /* Damn anakata. */
+ content_range.from = -1;
+ content_range.to = -1;
+ content_range.full_length = -1;
} else if(code != 304 && code != 412) {
full_len = len;
}