Lines Matching refs:out
67 static void openFile( OutData& out ) in openFile() argument
70 curl_easy_getinfo(out.curl, CURLINFO_EFFECTIVE_URL, &effective_url); in openFile()
73 curl_easy_getinfo(out.curl, CURLINFO_CONTENT_LENGTH_DOWNLOAD, &fDownloadSize); in openFile()
86 … out.File = out.DestinationDir + rtl::OStringToOUString(aURL.copy(nIndex), RTL_TEXTENCODING_UTF8); in openFile()
94 rc = osl_openFile(out.File.pData, &out.FileHandle, openFlags); in openFile()
96 if( osl_File_E_EXIST == rc && ! out.Handler->downloadTargetExists(out.File) ) in openFile()
98 out.StopCondition.set(); in openFile()
105 out.Handler->downloadStarted(out.File, (sal_Int64) fDownloadSize); in openFile()
141 OutData *out = reinterpret_cast < OutData * > (stream); in write_function() local
143 if( NULL == out->FileHandle ) in write_function()
144 openFile(*out); in write_function()
148 if( NULL != out->FileHandle ) in write_function()
149 osl_writeFile(out->FileHandle, ptr, size * nmemb, &nBytesWritten); in write_function()
162 OutData *out = reinterpret_cast < OutData * > (clientp); in progress_callback() local
164 OSL_ASSERT( out ); in progress_callback()
166 if( ! out->StopCondition.check() ) in progress_callback()
169 if ( dltotal + out->Offset ) in progress_callback()
170 fPercent = (dlnow + out->Offset) * 100 / (dltotal + out->Offset); in progress_callback()
176 curl_easy_getinfo(out->curl, CURLINFO_RESPONSE_CODE, &nCode); in progress_callback()
178 out->Handler->downloadProgressAt((sal_Int8)fPercent); in progress_callback()
246 bool curl_run(const rtl::OUString& rURL, OutData& out, const rtl::OString& aProxyHost, sal_Int32 nP… in curl_run() argument
258 out.curl = pCURL; in curl_run()
270 curl_easy_setopt(pCURL, CURLOPT_WRITEDATA, &out); in curl_run()
276 curl_easy_setopt(pCURL, CURLOPT_PROGRESSDATA, &out); in curl_run()
284 if( out.Offset > 0 ) in curl_run()
288 sal_Int64 offset = (sal_Int64) out.Offset; in curl_run()
295 if( NULL == out.FileHandle ) in curl_run()
296 openFile(out); in curl_run()
300 out.Handler->downloadFinished(out.File); in curl_run()
312 out.Handler->downloadFinished(out.File); in curl_run()
318 else if( (CURLE_ABORTED_BY_CALLBACK == cc) || out.StopCondition.check() ) in curl_run()
342 out.Handler->downloadFinished(out.File); in curl_run()
353 … out.Handler->downloadStalled( rtl::OStringToOUString(aMessage, RTL_TEXTENCODING_UTF8) ); in curl_run()
369 OutData out(m_aCondition); in start() local
388 …oslFileError rc = osl_openFile( aFile.pData, &out.FileHandle, osl_File_OpenFlag_Write | osl_File_O… in start()
389 osl_closeFile(out.FileHandle); in start()
390 out.FileHandle = NULL; in start()
409 out.File = aFile; in start()
410 out.DestinationDir = rDestinationDir; in start()
411 out.Handler = m_aHandler; in start()
415 oslFileError rc = osl_openFile(aFile.pData, &out.FileHandle, osl_File_OpenFlag_Write); in start()
420 if( osl_File_E_None == osl_setFilePos(out.FileHandle, osl_Pos_End, 0) ) in start()
422 osl_getFilePos(out.FileHandle, &out.Offset); in start()
426 out.File = rtl::OUString(); in start()
433 bool ret = curl_run(rURL, out, aProxyHost, nProxyPort); in start()
435 if( NULL != out.FileHandle ) in start()
437 osl_syncFile(out.FileHandle); in start()
438 osl_closeFile(out.FileHandle); in start()