After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 634770 - Failure to detect MIME type from RSS feed URI
Failure to detect MIME type from RSS feed URI
Status: RESOLVED FIXED
Product: totem-pl-parser
Classification: Core
Component: General
2.30.x
Other Linux
: Normal normal
: ---
Assigned To: totem-pl-parser-maint
totem-pl-parser-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-13 19:06 UTC by Michael Fötsch
Modified: 2010-11-15 11:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
main: Try harder to get the mime-type for a remote file (2.87 KB, patch)
2010-11-15 11:51 UTC, Bastien Nocera
committed Details | Review

Description Michael Fötsch 2010-11-13 19:06:57 UTC
totem_pl_parser_parse() fails with TOTEM_PL_PARSER_RESULT_UNHANDLED on http://faif.us/feeds/cast-mp3/

The problem seems to be inside function my_g_file_info_get_mime_type_with_data() in file totem-pl-parse.c. The function uses g_input_stream_read() to read up to 1024 bytes to detect the type of feed.

On this specific feed, g_input_stream_read() only returns the first line ("<?xml ...?>"), and so MIME type detection fails. This is consistent with the docs of g_input_stream_read(): The function may read fewer bytes, even if the end of the stream has not been reached.

Fix: Use g_input_stream_read_all() with a limit of 1024 bytes.

This issue makes it impossible to subscribe to the feed in Rhythmbox.
Comment 1 Bastien Nocera 2010-11-15 11:51:50 UTC
Created attachment 174503 [details] [review]
main: Try harder to get the mime-type for a remote file

Trying to parse http://faif.us/feeds/cast-mp3/ will fail because
the web server only returns the data line-by-line.
Comment 2 Bastien Nocera 2010-11-15 11:52:36 UTC
Attachment 174503 [details] pushed as 616a033 - main: Try harder to get the mime-type for a remote file