[maemo-commits] [maemo-commits] r11241 - projects/haf/trunk/osso-gnome-vfs2/debian/patches

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Apr 24 17:47:43 EEST 2007
Author: martyn
Date: 2007-04-24 17:47:42 +0300 (Tue, 24 Apr 2007)
New Revision: 11241

Added:
   projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-NB54743-workaround-broken-http-servers.patch
Removed:
   projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-workaround-broken-http-servers.patch
Log:
Include bug number in patch title so we can refer to the upstream bug when migrating to 2.18.x

Copied: projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-NB54743-workaround-broken-http-servers.patch (from rev 11240, projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-workaround-broken-http-servers.patch)

Deleted: projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-workaround-broken-http-servers.patch
===================================================================
--- projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-workaround-broken-http-servers.patch	2007-04-24 13:06:30 UTC (rev 11240)
+++ projects/haf/trunk/osso-gnome-vfs2/debian/patches/27-workaround-broken-http-servers.patch	2007-04-24 14:47:42 UTC (rev 11241)
@@ -1,102 +0,0 @@
-Index: modules/http-neon-method.c
-===================================================================
---- modules/http-neon-method.c	(revision 11158)
-+++ modules/http-neon-method.c	(working copy)
-@@ -1819,6 +1819,41 @@ http_follow_redirect (HttpContext *conte
- /* ************************************************************************** */
- /* Http operations */
- 
-+/* Sends a HEAD/GET request where we are not interested in any information
-+ * except headers. Some broken servers send the content for HEAD requests, so we
-+ * always try to read to get rid of that by closing the connection, and for the
-+ * case where this is used with GET as fallback for HEAD, we are also not
-+ * interested in the data.
-+ */
-+static int
-+dispatch_head_request (ne_request *req)
-+{
-+	gboolean must_close = FALSE;
-+	char buffer[1];
-+	size_t len;
-+	int res;
-+	
-+	do {
-+		res = ne_begin_request (req);
-+		
-+		if (NE_OK == res) {
-+			len = ne_read_response_block (req, buffer, sizeof buffer);
-+			must_close = (len > 0);
-+		}
-+
-+		if (NE_OK == res) {
-+			res = ne_end_request (req);
-+		}
-+	} while (NE_RETRY == res);
-+
-+	if (must_close) {
-+		DEBUG_HTTP ("explictly closing connection");
-+		ne_close_connection (ne_get_session (req));
-+	}
-+
-+	return res;
-+}
-+
- static GnomeVFSResult
- http_get_file_info (HttpContext *context, GnomeVFSFileInfo *info)
- {
-@@ -1898,7 +1933,7 @@ http_get_file_info (HttpContext *context
-  head_start:
- 	req  = ne_request_create (context->session, "HEAD", context->path);
- 
--	res = ne_request_dispatch (req);
-+	res = dispatch_head_request (req);
- 
- 	if (res == NE_REDIRECT) {
- 		ne_request_destroy (req);
-@@ -1916,6 +1951,32 @@ http_get_file_info (HttpContext *context
- 
- 	result = resolve_result (res, req);	
- 	
-+	if (res == NE_ERROR || result == GNOME_VFS_ERROR_NOT_SUPPORTED) {
-+		/* Assume that there was a broken server... fallback to GET. */
-+		DEBUG_HTTP ("Fall back to GET request");
-+		
-+		ne_request_destroy (req);
-+		req = NULL;
-+
-+		req = ne_request_create (context->session, "GET", context->path);
-+		res = dispatch_head_request (req);
-+
-+		if (res == NE_REDIRECT) {
-+			result = http_follow_redirect (context);		
-+
-+			ne_request_destroy (req);
-+			req = NULL;
-+		
-+			if (result == GNOME_VFS_OK) {
-+				goto head_start;
-+			} else {
-+				return result;
-+			}
-+		}
-+
-+		result = resolve_result (res, req);	
-+	}
-+	
- 	if (result == GNOME_VFS_OK) {
- 		const char *name;	
- 		
-@@ -1930,13 +1991,6 @@ http_get_file_info (HttpContext *context
- 		info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_TYPE;
- 
- 		std_headers_to_file_info (req, info);
--		
--		/* work-around for broken icecast server */
--		if (info->valid_fields & GNOME_VFS_FILE_INFO_FIELDS_MIME_TYPE
--		    && ! g_ascii_strcasecmp (info->mime_type, "audio/mpeg")) {
--			ne_close_connection (ne_get_session (req));
--		}
--		
- 	}
- 	
- 	ne_request_destroy (req);


More information about the maemo-commits mailing list