- cookies = soup_cookie_jar_new();
- soup_session_add_feature(s, SOUP_SESSION_FEATURE(cookies));
- g_signal_connect(cookies, "changed", G_CALLBACK(changecookie), NULL);
- reloadcookies();
+ soup_session_remove_feature_by_type(s, soup_cookie_get_type());
+ soup_session_remove_feature_by_type(s, soup_cookie_jar_get_type());
+ g_signal_connect_after(G_OBJECT(s), "request-started", G_CALLBACK(newrequest), NULL);
+
+ /* proxy */
+ if((proxy = getenv("http_proxy")) && strcmp(proxy, "")) {
+ new_proxy = g_strrstr(proxy, "http://") ? g_strdup(proxy) :
+ g_strdup_printf("http://%s", proxy);
+
+ puri = soup_uri_new(new_proxy);
+ g_object_set(G_OBJECT(s), "proxy-uri", puri, NULL);
+ soup_uri_free(puri);
+ g_free(new_proxy);
+ }