Subversion Repositories Tewi

Rev

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

Rev 342 Rev 347
Line 1... Line 1...
1
/* $Id: server.c 342 2024-10-14 18:25:41Z nishi $ */
1
/* $Id: server.c 347 2024-10-15 16:33:28Z 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
#include <nwthread.h>
67
#include <arpa/inet.h>
68
#define IPPROTO_TCP 0
68
#include <sys/select.h>
69
#define INADDR_ANY 0
69
#include <pthread.h>
70
#define htons(x) x
70
#define htons(x) x
71
#include "strptime.h"
71
#include "strptime.h"
72
#else
72
#else
73
#ifdef USE_POLL
73
#ifdef USE_POLL
74
#ifdef __PPU__
74
#ifdef __PPU__
Line 104... Line 104...
104
 
104
 
105
#ifdef __NeXT__
105
#ifdef __NeXT__
106
#include <sys/time.h>
106
#include <sys/time.h>
107
#endif
107
#endif
108
 
108
 
109
#if defined(__USLC__) || defined(__NeXT__) || defined(__NETWARE__)
109
#if defined(__USLC__) || defined(__NeXT__)
110
typedef int socklen_t;
110
typedef int socklen_t;
111
#endif
111
#endif
112
 
112
 
113
#ifndef S_ISDIR
113
#ifndef S_ISDIR
114
#define S_ISDIR(x) ((x) & _S_IFDIR)
114
#define S_ISDIR(x) ((x) & _S_IFDIR)
Line 930... Line 930...
930
					if(ext != NULL) free(ext);
930
					if(ext != NULL) free(ext);
931
					f = fopen(path, "rb");
931
					f = fopen(path, "rb");
932
					if(f == NULL) {
932
					if(f == NULL) {
933
						tw_http_error(s, sock, 403, name, port, vhost_entry);
933
						tw_http_error(s, sock, 403, name, port, vhost_entry);
934
					} else {
934
					} else {
-
 
935
#ifdef __NETWARE__
-
 
936
						tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime.tv_sec, cmtime);
-
 
937
#else
935
						tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
938
							tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime);
-
 
939
#endif
936
						fclose(f);
940
						fclose(f);
937
					}
941
					}
938
				}
942
				}
939
			} else {
943
			} else {
940
				if(!rej) {
944
				if(!rej) {
Line 958... Line 962...
958
	SSL_free(s);
962
	SSL_free(s);
959
#endif
963
#endif
960
	close_socket(sock);
964
	close_socket(sock);
961
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
965
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
962
#ifdef __NETWARE__
966
#ifdef __NETWARE__
963
	ExitThread(EXIT_THREAD, 0);
967
	pthread_exit(NULL);
964
#else
968
#else
965
	_endthread();
969
	_endthread();
966
#endif
970
#endif
967
#elif defined(__HAIKU__)
971
#elif defined(__HAIKU__)
968
		exit_thread(0);
972
		exit_thread(0);
Line 1069... Line 1073...
1069
#endif
1073
#endif
1070
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
1074
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__)
1071
#ifdef __OS2__
1075
#ifdef __OS2__
1072
					_beginthread(tw_server_pass, 0, 0, e);
1076
					_beginthread(tw_server_pass, 0, 0, e);
1073
#elif defined(__NETWARE__)
1077
#elif defined(__NETWARE__)
-
 
1078
					pthread_t thr;
-
 
1079
					pthread_create(&thr, NULL, (void* (*)(void*))tw_server_pass, e);
1074
					BeginThread(tw_server_pass, 0, 0, e);
1080
					pthread_detach(thr);
1075
#else
1081
#else
1076
					_beginthread(tw_server_pass, 0, e);
1082
					_beginthread(tw_server_pass, 0, e);
1077
#endif
1083
#endif
1078
#elif defined(_PSP) || defined(__PPU__)
1084
#elif defined(_PSP) || defined(__PPU__)
1079
						tw_server_pass(e);
1085
						tw_server_pass(e);