Subversion Repositories Tewi

Rev

Rev 69 | Rev 88 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 69 Rev 70
Line 1... Line 1...
1
/* $Id: http.c 69 2024-09-19 07:44:13Z nishi $ */
1
/* $Id: http.c 70 2024-09-19 09:23:45Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 80... Line 80...
80
			}
80
			}
81
#ifndef NO_SSL
81
#ifndef NO_SSL
82
		}
82
		}
83
#endif
83
#endif
84
		int len = tw_read(ssl, sock, buffer, 512);
84
		int len = tw_read(ssl, sock, buffer, 512);
85
		if(len <= 0){
85
		if(len <= 0) {
86
			bad = true;
86
			bad = true;
87
			break;
87
			break;
88
		}
88
		}
89
		int i;
89
		int i;
90
		for(i = 0; i < len; i++) {
90
		for(i = 0; i < len; i++) {
Line 282... Line 282...
282
	}
282
	}
283
	for(i = 0; req->path[i] != 0; i++) {
283
	for(i = 0; req->path[i] != 0; i++) {
284
		if(req->path[i] == '%') {
284
		if(req->path[i] == '%') {
285
			if(req->path[i + 1] == 0) continue;
285
			if(req->path[i + 1] == 0) continue;
286
			cbuf[0] = cm_hex(req->path + i + 1, 2);
286
			cbuf[0] = cm_hex(req->path + i + 1, 2);
-
 
287
			if(cbuf[0] != '\\') {
287
			char* tmp = result;
288
				char* tmp = result;
288
			result = cm_strcat(tmp, cbuf);
289
				result = cm_strcat(tmp, cbuf);
289
			free(tmp);
290
				free(tmp);
-
 
291
			}
290
			i += 2;
292
			i += 2;
291
		} else {
293
		} else if(req->path[i] != '\\') {
292
			cbuf[0] = req->path[i];
294
			cbuf[0] = req->path[i];
293
			char* tmp = result;
295
			char* tmp = result;
294
			result = cm_strcat(tmp, cbuf);
296
			result = cm_strcat(tmp, cbuf);
295
			free(tmp);
297
			free(tmp);
296
		}
298
		}
Line 322... Line 324...
322
				if(strlen(p) == 0) {
324
				if(strlen(p) == 0) {
323
					free(p);
325
					free(p);
324
					p = cm_strdup("/");
326
					p = cm_strdup("/");
325
				}
327
				}
326
			} else if(strcmp(pth, ".") == 0) {
328
			} else if(strcmp(pth, ".") == 0) {
327
			} else if(oldc != '\\') {
329
			} else {
328
				char* tmp = p;
330
				char* tmp = p;
329
				p = cm_strcat3(tmp, pth, cbuf);
331
				p = cm_strcat3(tmp, pth, cbuf);
330
				free(tmp);
332
				free(tmp);
331
			}
333
			}
332
 
334