This patch fixes it. Let me know how to clean it up and what else needs to be done so it can get accepted.
For simplicity, here is the old and new code:
Old: http://pastebin.com/pastebin.php?dl=m5c36b752
New: http://pastebin.com/pastebin.php?dl=ma05d1ab
Thanks.
CFileCurl::Exists always returns true, with an FTP address
mbuchoff
Junior Member Posts: 32 Joined: Jun 2007 Reputation: 0 |
2008-11-04 04:55
Post: #1
|
| find quote |
mbuchoff
Junior Member Posts: 32 Joined: Jun 2007 Reputation: 0 |
2008-11-04 15:15
Post: #2
(This post was last modified: 2008-11-04 16:46 by mbuchoff.)
|
| find quote |
jmarshall
Team-XBMC Developer Posts: 24,570 Joined: Oct 2003 Reputation: 138 |
2008-11-04 21:46
Post: #3
Thanks for the patch - can you perhaps detail why it was failing in the trac ticket?
Thanks! Jonathan Always read the XBMC online-manual, FAQ and search the forum before posting. Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules. For troubleshooting and bug reporting please make sure you read this first. ![]() |
| find quote |
mbuchoff
Junior Member Posts: 32 Joined: Jun 2007 Reputation: 0 |
2008-11-05 04:07
Post: #4
Of course...
If CFileCurl::Exists is called on a HTTP address, g_curlinterface.easy_perform returns CURLE_HTTP_RETURNED_ERROR when the file doesn't exist. It returns CURLE_WRITE_ERROR if the http file does exist (since a write was called with a null write-buffer). Unfortunately, when dealing with an FTP file, it returns CURLE_WRITE_ERROR regardless of whether the file exists. Therefore, I needed to add a check when getting the content length to see what the content length was... if the file exists the length is at least zero (even with a file with no content), but if it fails, the length is -1. I'm sure there is a more elegant way to do this, but I am a libCurl n00b. |
| find quote |

![[Image: badge.gif]](http://www.ohloh.net/projects/9132/badge.gif)
Search
Help