Subversion Repositories Tewi

Rev

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

Rev 23 Rev 43
Line 1... Line 1...
1
/* $Id: http.c 23 2024-09-14 13:31:16Z nishi $ */
1
/* $Id: http.c 43 2024-09-18 09:19:03Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
-
 
5
#include "../config.h"
-
 
6
 
5
#include "tw_http.h"
7
#include "tw_http.h"
6
 
8
 
7
#include "tw_server.h"
9
#include "tw_server.h"
8
 
10
 
9
#include <cm_log.h>
11
#include <cm_log.h>
Line 57... Line 59...
57
		FD_ZERO(&fds);
59
		FD_ZERO(&fds);
58
		FD_SET(sock, &fds);
60
		FD_SET(sock, &fds);
59
		struct timeval tv;
61
		struct timeval tv;
60
		tv.tv_sec = 5;
62
		tv.tv_sec = 5;
61
		tv.tv_usec = 0;
63
		tv.tv_usec = 0;
-
 
64
#ifndef NO_SSL
62
		if(ssl == NULL || !SSL_has_pending(ssl)) {
65
		if(ssl == NULL || !SSL_has_pending(ssl)) {
-
 
66
#endif
63
			int n = select(FD_SETSIZE, &fds, NULL, NULL, &tv);
67
			int n = select(FD_SETSIZE, &fds, NULL, NULL, &tv);
64
			if(n <= 0) {
68
			if(n <= 0) {
65
				free(header);
69
				free(header);
66
				tw_free_request(req);
70
				tw_free_request(req);
67
				return -1;
71
				return -1;
68
			}
72
			}
-
 
73
#ifndef NO_SSL
69
		}
74
		}
-
 
75
#endif
70
		int len = tw_read(ssl, sock, buffer, 512);
76
		int len = tw_read(ssl, sock, buffer, 512);
71
		if(len <= 0) break;
77
		if(len <= 0) break;
72
		int i;
78
		int i;
73
		for(i = 0; i < len; i++) {
79
		for(i = 0; i < len; i++) {
74
			char c = buffer[i];
80
			char c = buffer[i];