MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / DoraXrtHttpResolveRedirect

Function DoraXrtHttpResolveRedirect

Source/Http/XrtHttpClient.c:121–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121static 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
137typedef struct DoraXrtHttpStreamContext {
138 xnetfuture* future;

Callers 2

DoraXrtHttpExecuteFunction · 0.85
DoraXrtHttpExecuteStreamFunction · 0.85

Calls 1

strlenFunction · 0.85

Tested by

no test coverage detected