diff stream/network.c @ 35301:8f6d3f8ffa61

Add url_new_with_proxy function to reduce code duplication and memleaks.
author reimar
date Sat, 10 Nov 2012 13:19:29 +0000
parents 4dc2b1261d29
children 525bcc0a8e16
line wrap: on
line diff
--- a/stream/network.c	Sat Nov 10 13:18:38 2012 +0000
+++ b/stream/network.c	Sat Nov 10 13:19:29 2012 +0000
@@ -186,6 +186,14 @@
 	return url_out;
 }
 
+URL_t *url_new_with_proxy(const char *urlstr)
+{
+	URL_t *url = url_new(urlstr);
+	URL_t *url_with_proxy = check4proxies(url);
+	url_free(url);
+	return url_with_proxy;
+}
+
 int
 http_send_request( URL_t *url, off_t pos ) {
 	HTTP_header_t *http_hdr;