hrev46384 adds 1 changeset to branch 'master' old head: 94fb954c53b88e1c2c39648b35e1db08679cca0b new head: ba3f67bfb4dc51b44af353deecc256f7a18b294c overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=ba3f67b+%5E94fb954 ---------------------------------------------------------------------------- ba3f67b: FileRequest: make sure we're dealing with a file. Trying to Read from a directory results in an error code, but we also missed that because an unsigned variable was used to store the result. Fixes #10210. [ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ] ---------------------------------------------------------------------------- Revision: hrev46384 Commit: ba3f67bfb4dc51b44af353deecc256f7a18b294c URL: http://cgit.haiku-os.org/haiku/commit/?id=ba3f67b Author: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> Date: Mon Nov 18 08:53:04 2013 UTC Ticket: https://dev.haiku-os.org/ticket/10210 ---------------------------------------------------------------------------- 1 file changed, 2 insertions(+), 2 deletions(-) src/kits/network/libnetapi/FileRequest.cpp | 4 ++-- ---------------------------------------------------------------------------- diff --git a/src/kits/network/libnetapi/FileRequest.cpp b/src/kits/network/libnetapi/FileRequest.cpp index a57b155..6e50909 100644 --- a/src/kits/network/libnetapi/FileRequest.cpp +++ b/src/kits/network/libnetapi/FileRequest.cpp @@ -35,7 +35,7 @@ BFileRequest::_ProtocolLoop() // FIXME error handling (file does not exists, etc.) BFile file(fUrl.Path().String(), B_READ_ONLY); - if(file.InitCheck() != B_OK) + if(file.InitCheck() != B_OK || !file.IsFile()) return B_PROT_CONNECTION_FAILED; // Send all notifications to listener, if any @@ -45,7 +45,7 @@ BFileRequest::_ProtocolLoop() file.GetSize(&size); fListener->DownloadProgress(this, size, size); - size_t chunkSize; + ssize_t chunkSize; char chunk[4096]; while((chunkSize = file.Read(chunk, sizeof(chunk))) > 0) fListener->DataReceived(this, chunk, chunkSize);