Subversion Repositories Tewi

Rev

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

Rev 348 Rev 349
Line 1... Line 1...
1
/* $Id: server.c 348 2024-10-15 19:55:34Z nishi $ */
1
/* $Id: server.c 349 2024-10-15 20:08:08Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "../config.h"
5
#include "../config.h"
6
 
6
 
Line 62... Line 62...
62
 
62
 
63
#include "strptime.h"
63
#include "strptime.h"
64
typedef int socklen_t;
64
typedef int socklen_t;
65
#elif defined(__NETWARE__)
65
#elif defined(__NETWARE__)
66
#include <sys/socket.h>
66
#include <sys/socket.h>
-
 
67
 
67
#include <arpa/inet.h>
68
#define IPPROTO_TCP 0
68
#include <sys/select.h>
-
 
69
#include <pthread.h>
69
#define INADDR_ANY 0
70
#define htons(x) x
70
#define htons(x) x
71
#include "strptime.h"
71
#include "strptime.h"
-
 
72
typedef int socklen_t;
72
#else
73
#else
73
#ifdef USE_POLL
74
#ifdef USE_POLL
74
#ifdef __PPU__
75
#ifdef __PPU__
75
#include <net/poll.h>
76
#include <net/poll.h>
76
#else
77
#else
Line 933... Line 934...
933
					if(ext != NULL) free(ext);
934
					if(ext != NULL) free(ext);
934
					f = fopen(path, "rb");
935
					f = fopen(path, "rb");
935
					if(f == NULL) {
936
					if(f == NULL) {
936
						tw_http_error(s, sock, 403, name, port, vhost_entry);
937
						tw_http_error(s, sock, 403, name, port, vhost_entry);
937
					} else {
938
					} else {
938
#ifdef __NETWARE__
-
 
939
						tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime.tv_sec, cmtime);
-
 
940
#else
-
 
941
							tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
939
						tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
942
#endif
-
 
943
						fclose(f);
940
						fclose(f);
944
					}
941
					}
945
				}
942
				}
946
			} else {
943
			} else {
947
				if(!rej) {
944
				if(!rej) {
Line 965... Line 962...
965
	SSL_free(s);
962
	SSL_free(s);
966
#endif
963
#endif
967
	close_socket(sock);
964
	close_socket(sock);
968
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
965
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
969
#ifdef __NETWARE__
966
#ifdef __NETWARE__
970
	pthread_exit(NULL);
-
 
971
#else
967
#else
972
	_endthread();
968
	_endthread();
973
#endif
969
#endif
974
#elif defined(__HAIKU__)
970
#elif defined(__HAIKU__)
975
		exit_thread(0);
971
		exit_thread(0);
Line 1076... Line 1072...
1076
#endif
1072
#endif
1077
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
1073
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
1078
#ifdef __OS2__
1074
#ifdef __OS2__
1079
					_beginthread(tw_server_pass, 0, 0, e);
1075
					_beginthread(tw_server_pass, 0, 0, e);
1080
#elif defined(__NETWARE__)
1076
#elif defined(__NETWARE__)
1081
					pthread_t thr;
-
 
1082
					pthread_create(&thr, NULL, (void* (*)(void*))tw_server_pass, e);
-
 
1083
					pthread_detach(thr);
1077
					tw_server_pass(e);
1084
#else
1078
#else
1085
					_beginthread(tw_server_pass, 0, e);
1079
					_beginthread(tw_server_pass, 0, e);
1086
#endif
1080
#endif
1087
#elif defined(_PSP) || defined(__PPU__)
1081
#elif defined(_PSP) || defined(__PPU__)
1088
						tw_server_pass(e);
1082
						tw_server_pass(e);