else
{
const std::string& resourcePath = request.GetPath();
- if( resourcePath.length() > 7 && strncasecmp( resourcePath.c_str(), "http://", 7 ) == 0 )
+ if( strncasecmp( resourcePath.c_str(), "http", 4 ) == 0 )
{
- requestType = ResourceThreadBase::RequestDownload;
- workerThread = remoteImageThread;
+ if( resourcePath.size() > 4 &&
+ ( strncasecmp( &resourcePath.c_str()[4], "://", 3 ) == 0 ||
+ strncasecmp( &resourcePath.c_str()[4], "s://", 4) == 0 ) )
+ {
+ requestType = ResourceThreadBase::RequestDownload;
+ workerThread = remoteImageThread;
+ }
+ else
+ {
+ requestType = ResourceThreadBase::RequestLoad;
+ workerThread = localImageThread;
+ }
}
else
{
using namespace Dali::Integration;
+namespace
+{
+const int CONNECTION_TIMEOUT( 30 );
+}
+
namespace Dali
{
curl_easy_setopt( curl_handle, CURLOPT_VERBOSE, 0 );
curl_easy_setopt( curl_handle, CURLOPT_URL, request.GetPath().c_str() );
curl_easy_setopt( curl_handle, CURLOPT_FAILONERROR, 1 );
+ curl_easy_setopt( curl_handle, CURLOPT_CONNECTTIMEOUT, CONNECTION_TIMEOUT );
// Download header first to get data size
char* headerBytes = NULL;
}
else
{
- DALI_LOG_WARNING( "Failed to download file to load \"%s\"\n", request.GetPath().c_str() );
+ DALI_LOG_WARNING( "Failed to download http header for \"%s\" with error code %d\n", request.GetPath().c_str(), cresult );
succeeded = false;
}
cresult = curl_easy_perform( curl_handle );
if( CURLE_OK != cresult )
{
- DALI_LOG_WARNING( "Failed to download file to load \"%s\"\n", request.GetPath().c_str() );
+ DALI_LOG_WARNING( "Failed to download image file \"%s\" with error code %d\n", request.GetPath().c_str(), cresult );
succeeded = false;
}
}