Converts e.g. "http://dl.dropbox.com/xyZ" into "https://dl.dropboxusercontent.com/xyZ" */
| 64 | |
| 65 | /* Converts e.g. "http://dl.dropbox.com/xyZ" into "https://dl.dropboxusercontent.com/xyZ" */ |
| 66 | static void GetFinalUrl(struct HttpRequest* req, cc_string* dst) { |
| 67 | cc_string url = String_FromRawArray(req->url); |
| 68 | cc_string resource; |
| 69 | int i; |
| 70 | |
| 71 | for (i = 0; i < Array_Elems(url_rewrite_srcs); i++) |
| 72 | { |
| 73 | if (!String_CaselessStarts(&url, &url_rewrite_srcs[i])) continue; |
| 74 | |
| 75 | resource = String_UNSAFE_SubstringAt(&url, url_rewrite_srcs[i].length); |
| 76 | String_Format2(dst, "%c%s", url_rewrite_dsts[i], &resource); |
| 77 | return; |
| 78 | } |
| 79 | String_Copy(dst, &url); |
| 80 | } |
| 81 | |
| 82 | #define HTTP_MAX_CONCURRENCY 6 |
| 83 | static void Http_StartNextDownload(void) { |
no test coverage detected