Update of /cvsroot/freenet/freenet/src/freenet/client/http/filter
In directory sc8-pr-cvs1:/tmp/cvs-serv25430/src/freenet/client/http/filter
Modified Files:
SaferFilter.java
Log Message:
6296:
A few more Eclipse warning fixes, slightly functional this time - use our built-in URL
codecs, rather than the deprecated java ones, for example, and catch their exceptions.
Add support for deprecated options - which won't be written out when generating a
config, but will be recognized if set. bandwidthLimit and averageBandwidthLimit are
the first.
Change way we handle deprecated bandwidthLimit option, hopefully fix constant 100%
load.
Remove unused method NGRouting.transferFailed().
Index: SaferFilter.java
===================================================================
RCS file: /cvsroot/freenet/freenet/src/freenet/client/http/filter/SaferFilter.java,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -w -r1.54 -r1.55
--- SaferFilter.java 31 Oct 2003 18:13:15 -0000 1.54
+++ SaferFilter.java 1 Nov 2003 15:13:35 -0000 1.55
@@ -28,6 +28,9 @@
import freenet.support.HTMLEncoder;
import freenet.support.Logger;
import freenet.support.NullBucket;
+import freenet.support.URLDecoder;
+import freenet.support.URLEncodedFormatException;
+import freenet.support.URLEncoder;
import freenet.support.io.NullInputStream;
public class SaferFilter implements ContentFilter {
@@ -1502,8 +1505,8 @@
x = t.indexOf('=');
if (x != -1) {
try {
- String name =
java.net.URLDecoder.decode(t.substring(0, x));
- String value =
java.net.URLDecoder.decode(t.substring(x + 1));
+ String name =
URLDecoder.decode(t.substring(0, x));
+ String value =
URLDecoder.decode(t.substring(x + 1));
if (name != null && value !=
null) {
if
(name.equals("date")) {
date = value;
@@ -1527,6 +1530,11 @@
}
}
} catch (IllegalArgumentException e) {
+ } catch (URLEncodedFormatException e) {
+
if(Core.logger.shouldLog(Logger.MINOR, SaferFilter.class))
+
Core.logger.log(SaferFilter.class, "Caught "+e+" decoding "+t+", join at char "+x+
+ " in
sanitizeURI("+uri+", "+overrideType+", "+overrideCharset+")",
+ e,
Logger.MINOR);
}
}
}
@@ -1539,7 +1547,7 @@
StringBuffer ret = new StringBuffer(path);
char c = '?';
if (date != null && !date.equals("")) {
- date = java.net.URLEncoder.encode(date);
+ date = URLEncoder.encode(date);
if (date != null) {
ret.append(c);
ret.append("date=");
@@ -1562,7 +1570,7 @@
c = '&';
}
if (mime != null && !mime.equals("")) {
- mime = java.net.URLEncoder.encode(mime);
+ mime = URLEncoder.encode(mime);
if (mime != null) {
ret.append(c);
ret.append("mime=");
_______________________________________________
cvs mailing list
[EMAIL PROTECTED]
http://dodo.freenetproject.org/cgi-bin/mailman/listinfo/cvs