| 119 | } |
| 120 | |
| 121 | static int DoraXrtHttpResolveRedirect(const char* baseUrl, const char* location, char* outUrl, size_t outUrlCap) { |
| 122 | xrturlview baseView; |
| 123 | size_t outLen = 0; |
| 124 | if (!baseUrl || !location || !outUrl || outUrlCap == 0u) { |
| 125 | return 0; |
| 126 | } |
| 127 | if (!xrtUrlParseView(baseUrl, &baseView)) { |
| 128 | return 0; |
| 129 | } |
| 130 | if (!xrtUrlResolveTo(&baseView, location, strlen(location), outUrl, outUrlCap, &outLen)) { |
| 131 | return 0; |
| 132 | } |
| 133 | outUrl[outLen < outUrlCap ? outLen : outUrlCap - 1u] = '\0'; |
| 134 | return 1; |
| 135 | } |
| 136 | |
| 137 | typedef struct DoraXrtHttpStreamContext { |
| 138 | xnetfuture* future; |
no test coverage detected