[kaffe] Patch: http proxy correction

Jukka Santala jsantala at morphine.tml.hut.fi
Tue Oct 22 05:29:10 PDT 2002


Well, this proves nobody actually uses Kaffe with proxy for HTTP
implementations ;) My last patch to match its behaviour with Sun's
behaviour unfortunately broke the proxy support; it did open a socket to
the proxy, but then nonetheless use the proxyless connection. I tried to
think of a more elegant way to do it, but couldn't come up with one, so
here's the straightforward patch.

Tue Oct 22 15:22:23 EEST 2002 Jukka Santala <jsantala at nic.fi>
	* libraries/javalib/kaffe/net/www/protocol/http/
	HttpURLConnection.java: Actually use the proxy socket.

I think Kaffe's overall proxy-handling is not quite up to par with Sun's,
altough large part of this is due to it being one of Sun's undocumented
features. I may have reason to look into Kaffe's proxy-handling in detail,
but in the meanwhile I think this patch should go in for people who do
need working http proxy.

Proxy authenticiation... Is there anythign we can do about sun.util.Base64
or whatever? Kaffe has its own implementation, but apparently can't be
named the same.

 -Jukka Santala
-------------- next part --------------
Index: libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java,v
retrieving revision 1.12
diff -u -r1.12 HttpURLConnection.java
--- libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java	8 May 2002 18:25:51 -0000	1.12
+++ libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java	22 Oct 2002 12:17:49 -0000
@@ -88,12 +88,14 @@
 			}
 		}
 
-		port = url.getPort();
-		host = url.getHost();
-		if (port == -1) {
-			port = 80;
+		if (sock == null) {
+			port = url.getPort();
+			host = url.getHost();
+			if (port == -1) {
+				port = 80;
+			}
+			sock = new Socket(host, port);
 		}
-		sock = new Socket(host, port);
 
 		in = new BufferedInputStream(sock.getInputStream());
 		out = new DataOutputStream(sock.getOutputStream());


More information about the kaffe mailing list