==============================================================================
| 111 | |
| 112 | //============================================================================== |
| 113 | std::unique_ptr<URL::DownloadTask> URL::DownloadTask::createFallbackDownloader (const URL& urlToUse, |
| 114 | const File& targetFileToUse, |
| 115 | const String& extraHeadersToUse, |
| 116 | Listener* listenerToUse, |
| 117 | bool usePostRequest) |
| 118 | { |
| 119 | const size_t bufferSize = 0x8000; |
| 120 | targetFileToUse.deleteFile(); |
| 121 | |
| 122 | if (auto outputStream = targetFileToUse.createOutputStream (bufferSize)) |
| 123 | { |
| 124 | auto stream = std::make_unique<WebInputStream> (urlToUse, usePostRequest); |
| 125 | stream->withExtraHeaders (extraHeadersToUse); |
| 126 | |
| 127 | if (stream->connect (nullptr)) |
| 128 | return std::make_unique<FallbackDownloadTask> (std::move (outputStream), |
| 129 | bufferSize, |
| 130 | std::move (stream), |
| 131 | listenerToUse); |
| 132 | } |
| 133 | |
| 134 | return nullptr; |
| 135 | } |
| 136 | |
| 137 | URL::DownloadTask::DownloadTask() {} |
| 138 | URL::DownloadTask::~DownloadTask() {} |
nothing calls this directly
no test coverage detected