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 332816 - neon-based http module can't transfer from server which don't allow HEAD
neon-based http module can't transfer from server which don't allow HEAD
Status: RESOLVED WONTFIX
Product: gnome-vfs
Classification: Deprecated
Component: Module: http
cvs (head)
Other Linux
: Normal normal
: ---
Assigned To: gnome-vfs maintainers
gnome-vfs maintainers
gnome[unmaintained]
: 343709 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-02-28 06:35 UTC by James "Doc" Livingston
Modified: 2018-08-17 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
332816.php - PHP script which refuses to handle HEAD requests (185 bytes, text/plain)
2006-03-04 23:56 UTC, Mathias Hasselmann (IRC: tbf)
  Details
gnome-bug-332816.patch (1.12 KB, patch)
2006-03-05 00:30 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
gnome-bug-332816-r1.patch (1.49 KB, patch)
2006-03-05 01:30 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
gnome-bug-332816-r2.patch (2.51 KB, patch)
2006-03-05 03:01 UTC, Mathias Hasselmann (IRC: tbf)
none Details | Review
Fix crash with the previous patch (2.81 KB, patch)
2007-11-13 09:49 UTC, Richard Hult
none Details | Review

Description James "Doc" Livingston 2006-02-28 06:35:21 UTC
The old http module contained code to handle servers which work with GET but report errors for HEAD (in do_get_file_info, line 2695 of current cvs).

The neon-based http module doesn't contain this, which makes gnome_vfs_xfer_uri not work for URIs on those kinds of servers.
Comment 1 Mathias Hasselmann (IRC: tbf) 2006-03-04 23:40:51 UTC
How to reproduce. 

1) Install the attached PHP script on your local web server.
2) Invoke 'gnomevfs-info http://localhost/332816.php'

Expected result:

Name              : 332816.php
Type              : Regular
MIME type         : text/html
Default app       : epiphany.desktop
Access time       : Sun Mar  5 00:39:26 2006

Current result:

Error: Unsupported operation
Comment 2 Mathias Hasselmann (IRC: tbf) 2006-03-04 23:56:53 UTC
Created attachment 60670 [details]
332816.php - PHP script which refuses to handle HEAD requests
Comment 3 Mathias Hasselmann (IRC: tbf) 2006-03-05 00:30:26 UTC
Created attachment 60671 [details] [review]
gnome-bug-332816.patch

Solves the problem for the virtual test case. Hope it also handles your problematic server, Doc.
Comment 4 Mathias Hasselmann (IRC: tbf) 2006-03-05 01:30:43 UTC
Created attachment 60673 [details] [review]
gnome-bug-332816-r1.patch

Variant of the version patch, trying not to read the response body, when falling back to GET request.
Comment 5 Mathias Hasselmann (IRC: tbf) 2006-03-05 03:01:54 UTC
Created attachment 60676 [details] [review]
gnome-bug-332816-r2.patch

Third incarnation: Taking into account, that some broken servers send real content in response to HEAD requests. So I try avoid reading of the reponse body for GET *and* HEAD requests now. Nice side effect: The icecast workarround should not be needed anymore, as fetch_headers should automatically take care about it.
Comment 6 James "Doc" Livingston 2006-03-05 05:23:28 UTC
I seem to be lacking the necessary library-path-fu today to get this to work. An example URI that doesn't work is http://images.amazon.com/images/P/Burnout%203%20Soundtrack.01._SCTHUMBZZZ_.jpg, which is one of Amazon's cover art images.
Comment 7 Christian Kellner 2006-03-14 19:13:03 UTC
Yay! Another version of BROKEN WEBSERVER. YAY!
<some swearing>#$)(U*$)(#U)F(DUE)F(U#)($U$)(U</some swearing>
See:
+-[1 HEAD]-----------------------------------------------------------+
HEAD /images/P/Burnout%203%20Soundtrack.01._SCTHUMBZZZ_.jpg HTTP/1.1

Host: images.amazon.com

User-Agent: gnome-vfs/2.13.92 neon/0.25.4

[...]



HTTP/1.1 404 Not Found

Content-Type: text/html; charset=iso-8859-1


[...]

+----------------------------------------------+
And now:
+-[1 GET]------------------------------------------------------------+
GET /images/P/Burnout%203%20Soundtrack.01._SCTHUMBZZZ_.jpg HTTP/1.1

Host: images.amazon.com

User-Agent: gnome-vfs/2.13.92 neon/0.25.4




HTTP/1.1 200 OK

Server: Apache


Content-Type: image/gif

Content-Length: 807

X-Junk: xxxxx

+----------------------------------------------+

GET  /images/P/Burnout%203%20Soundtrack.01._SCTHUMBZZZ_.jpg HTTP/1.1
HEAD /images/P/Burnout%203%20Soundtrack.01._SCTHUMBZZZ_.jpg HTTP/1.1

This is not a gnome-vfs bug. It is NOT!.

But anyway, maybe we *should* fallback to get in any case that HEAD didn't work. Gives us another roundtrip but *shrug*. Or just get rid of doing HEAD at all and always killing the connection. Since nobody else gives a damn about RFCs maybe we shoudn't do either. Opinions and comments are welcome!
;)
Comment 8 Christian Kellner 2006-03-14 19:48:56 UTC
Reassigning to me, so I have that sticky in my TODO
Comment 9 Christian Kellner 2006-06-02 20:10:05 UTC
*** Bug 343709 has been marked as a duplicate of this bug. ***
Comment 10 Sam Morris 2006-08-15 18:35:46 UTC
Would it at least be possible to return something other than 'generic error' to the program? libwww-perl's "Server closed connection without sending any data back" is short and descriptive. I'm sick of seeing "Unknown playback error" messages in Rhythmbox. :)
Comment 11 Richard Hult 2006-12-18 12:57:15 UTC
I've played around a bit with the latest version of the patch here and it seems to be working well for the cases that it means to fix, i.e. when the server doesn't support HEAD at all and when it actually sends the content as well for HEAD requests. The amazon example is just so broken, I wonder if it wouldn't be better to bug them to fix the server.

However, I had to change 

+		if (GNOME_VFS_ERROR_NOT_SUPPORTED == result) {

to

  if (res == NE_ERROR)

since I always get that when HEAD isn't working (which translates to generic error). Maybe we need to check res == NE_ERROR || result == GNOME_VFS_ERROR_NOT_SUPPORTED)?

Should we get this committed? It does fix a lot of broken audio streaming servers, which seem to be plenty in numbers. And for working servers that return proper responses, we won't get the extra roundtrip for normal errors like not found etc.
Comment 12 Richard Hult 2007-11-13 09:42:16 UTC
I ran into an issue with the patch, if the connection goes down while in the workaround code, there is a crash:

+		if (NE_OK == res)
+			res = ne_end_request(req);

If len has returned -1 just above, there is no socket to end the request with, resulting in a crash. Also I think it would be better to separate the retry loop for begin and end. I will attach the patch I am using myself (slighty edited with names and comments, sorry about that, but it makes it easier to understand for me every time I have to go back and look at it again...).
Comment 13 Richard Hult 2007-11-13 09:49:19 UTC
Created attachment 99011 [details] [review]
Fix crash with the previous patch
Comment 14 Christian Kellner 2010-02-20 12:25:53 UTC
Mass re-assignin old gnome-vfs http bugs to gnome-vfs-maint@gnome.bugs so they disappear from my "My bugs" list. Sorry for the spam.
Comment 15 André Klapper 2018-08-17 13:49:29 UTC
gnome-vfs got deprecated in 2008.

gnome-vfs is not under active development anymore and had its last code changes
in 2011. Its codebase has been archived:
https://gitlab.gnome.org/Archive/gnome-vfs/commits/master

gio (in glib) and gvfs are its successors. See https://developer.gnome.org/gio/stable/ch33.html and https://people.gnome.org/~gicmo/gio-migration-guide/ for porting info.

Closing this report as WONTFIX as part of Bugzilla Housekeeping to reflect
reality. Feel free to open a task in GNOME Gitlab if the issue described in this task still applies to a recent + supported version of glib/gio/gvfs. Thanks!