[maemo-commits] [maemo-commits] r8811 - in projects/haf/trunk/osso-gnome-vfs2/debian: . patches
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Dec 19 11:05:15 EET 2006
- Previous message: [maemo-commits] r8810 - in projects/haf/trunk/osso-gnome-vfs2: . dbus-daemon debian
- Next message: [maemo-commits] r8812 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop test
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: richard Date: 2006-12-19 11:05:14 +0200 (Tue, 19 Dec 2006) New Revision: 8811 Added: projects/haf/trunk/osso-gnome-vfs2/debian/patches/22-workaround-broken-http-servers.patch Modified: projects/haf/trunk/osso-gnome-vfs2/debian/changelog Log: Add patch for broken http servers. Modified: projects/haf/trunk/osso-gnome-vfs2/debian/changelog =================================================================== --- projects/haf/trunk/osso-gnome-vfs2/debian/changelog 2006-12-19 09:03:22 UTC (rev 8810) +++ projects/haf/trunk/osso-gnome-vfs2/debian/changelog 2006-12-19 09:05:14 UTC (rev 8811) @@ -1,6 +1,7 @@ osso-gnome-vfs2 (2.12.0.19-2osso1) unstable; urgency=low * Revert the change in .18 since we don't want that in this branch + * Fixes NB#43533, Media player failed to play some user added radio -- Richard Hult <richard at imendio.com> Tue, 19 Dec 2006 09:59:57 +0100 Added: projects/haf/trunk/osso-gnome-vfs2/debian/patches/22-workaround-broken-http-servers.patch =================================================================== --- projects/haf/trunk/osso-gnome-vfs2/debian/patches/22-workaround-broken-http-servers.patch 2006-12-19 09:03:22 UTC (rev 8810) +++ projects/haf/trunk/osso-gnome-vfs2/debian/patches/22-workaround-broken-http-servers.patch 2006-12-19 09:05:14 UTC (rev 8811) @@ -0,0 +1,80 @@ +Index: modules/http-neon-method.c +=================================================================== +--- modules/http-neon-method.c (revision 8808) ++++ modules/http-neon-method.c (working copy) +@@ -1832,6 +1832,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) + { +@@ -1896,8 +1931,19 @@ http_get_file_info (HttpContext *context + + add_default_header_handlers (req, info); + +- res = ne_request_dispatch (req); ++ res = dispatch_head_request (req); ++ 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 = ne_request_create (context->session, "GET", context->path); ++ add_default_header_handlers (req, info); ++ res = dispatch_head_request (req); ++ } ++ + if (res == NE_REDIRECT) { + result = http_follow_redirect (context); + +@@ -1922,12 +1968,6 @@ http_get_file_info (HttpContext *context + info->flags = GNOME_VFS_FILE_FLAGS_NONE; + + info->valid_fields |= GNOME_VFS_FILE_INFO_FIELDS_TYPE; +- +- /* work-around for broken icecast server */ +- if (! g_ascii_strcasecmp (info->mime_type, "audio/mpeg")) { +- ne_close_connection (ne_get_session (req)); +- } +- + } + + return result;
- Previous message: [maemo-commits] r8810 - in projects/haf/trunk/osso-gnome-vfs2: . dbus-daemon debian
- Next message: [maemo-commits] r8812 - in projects/haf/branches/maemo-af-desktop/hildon-desktop: . libhildondesktop test
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]