MCPcopy Create free account
hub / github.com/3proxy/3proxy / decodeurl

Function decodeurl

src/proxy.c:158–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

156}
157
158void decodeurl(unsigned char *s, int allowcr){
159 unsigned char *d = s;
160 unsigned u;
161
162 while(*s){
163 if(*s == '%' && ishex(s[1]) && ishex(s[2])){
164 sscanf((char *)s+1, "%2x", &u);
165 if(allowcr && u != '\r')*d++ = u;
166 else if (u != '\r' && u != '\n') {
167 if (u == '\"' || u == '\\') *d++ = '\\';
168 else if (u == 255) *d++ = 255;
169 *d++ = u;
170 }
171 s+=3;
172 }
173 else if(!allowcr && *s == '?') {
174 break;
175 }
176 else if(*s == '+') {
177 *d++ = ' ';
178 s++;
179 }
180 else {
181 *d++ = *s++;
182 }
183 }
184 *d = 0;
185}
186
187void file2url(unsigned char *sb, unsigned char *buf, unsigned bufsize, int * inbuf, int skip255){
188 for(; *sb; sb++){

Callers 2

proxychildFunction · 0.85
adminchildFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected