?

Log in

No account? Create an account
Here is a patch against logjam 4.5.1 that should fix proxy support… - LogJam [entries|archive|friends|userinfo]
LogJam

[ website | LogJam ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Dec. 20th, 2005|12:22 pm]
LogJam

logjam

[go_team_ari]
Here is a patch against logjam 4.5.1 that should fix proxy support when built with libsoup. I haven't been able to test authenticated proxy support, so I'm not sure if it works. but it should.

--- logjam-4.5.1.orig/src/network-soup.c
+++ logjam-4.5.1/src/network-soup.c
@@ -51,15 +51,24 @@
 	GString *response = NULL;
 	CallbackInfo info = { cb, data, 0, 0 };
 
-	suri = soup_uri_new(url);
+	suri = soup_uri_new(conf.options.useproxy ? conf.proxy : url);
 	sock = soup_socket_client_new_sync(suri->host, suri->port, NULL, &status);
 	if (status != SOUP_STATUS_OK) {
 		g_set_error(err, NET_ERROR, NET_ERROR_GENERIC,
 				soup_status_get_phrase(status));
 		goto out;
 	}
+	g_free(suri);
+	suri = NULL;
 
-	req = soup_message_new(post ? "POST" : "GET", url);
+	suri = soup_uri_new(url);
+	if(conf.options.useproxy && conf.options.useproxyauth) {
+		g_free(suri->user);
+		g_free(suri->passwd);
+		suri->user = g_strdup(conf.proxyuser);
+		suri->passwd = g_strdup(conf.proxypass);
+	}
+	req = soup_message_new_from_uri(post ? "POST" : "GET", suri);
 	g_signal_connect(G_OBJECT(req), "got-chunk",
 			G_CALLBACK(got_chunk_cb), &info);
 	for (; headers; headers = headers->next) {
LinkReply