From: Nishi Date: Tue, 15 Oct 2024 20:08:08 +0000 (+0000) Subject: fix some stuff X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=e13d3189f6c409d2ad0592970649861f27fa2b19;p=tewi.git fix some stuff git-svn-id: file:///raid/svn-personal/tewi/trunk@349 8739d7e6-ffea-ec47-b151-bdff447c6205 --- diff --git a/Server/config.c b/Server/config.c index 00fa104..53d860e 100644 --- a/Server/config.c +++ b/Server/config.c @@ -32,7 +32,7 @@ #endif #ifdef __NETWARE__ -#include +#include #endif #include "tw_config.h" #include "tw_module.h" diff --git a/Server/http.c b/Server/http.c index 94dacf9..cf74139 100644 --- a/Server/http.c +++ b/Server/http.c @@ -29,7 +29,6 @@ #endif #elif defined(__NETWARE__) #include -#include #else #ifdef USE_POLL #ifdef __PPU__ diff --git a/Server/main.c b/Server/main.c index f6b9fbc..2400b33 100644 --- a/Server/main.c +++ b/Server/main.c @@ -37,8 +37,6 @@ #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__)) #include #elif defined(__NETWARE__) -#include -#include #endif #ifdef _PSP diff --git a/Server/module.c b/Server/module.c index 50c29b4..8ebd395 100644 --- a/Server/module.c +++ b/Server/module.c @@ -32,7 +32,8 @@ int tw_module_init(void* mod) { return 1; } #define INCL_DOSERRORS #include #elif defined(__NETWARE__) -#include +#include +#include #else #include #include @@ -58,7 +59,8 @@ void* tw_module_load(const char* path) { } lib = (void*)mod; #elif defined(__NETWARE__) - lib = dlopen(path, RTLD_LAZY); + *hnd = FindNLMHandle(path); + lib = (void*)hnd; #else lib = LoadLibraryA(path); #endif @@ -84,7 +86,7 @@ void* tw_module_symbol(void* mod, const char* sym) { } return ret; #elif defined(__NETWARE__) - return dlsym(mod, sym); + return ImportSymbol(*(unsigned int*)mod, sym); #else return GetProcAddress(mod, sym); #endif diff --git a/Server/server.c b/Server/server.c index 58fdf3a..7a42474 100644 --- a/Server/server.c +++ b/Server/server.c @@ -64,11 +64,12 @@ typedef int socklen_t; typedef int socklen_t; #elif defined(__NETWARE__) #include -#include -#include -#include + +#define IPPROTO_TCP 0 +#define INADDR_ANY 0 #define htons(x) x #include "strptime.h" +typedef int socklen_t; #else #ifdef USE_POLL #ifdef __PPU__ @@ -935,11 +936,7 @@ int tw_server_pass(void* ptr) { if(f == NULL) { tw_http_error(s, sock, 403, name, port, vhost_entry); } else { -#ifdef __NETWARE__ - tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime.tv_sec, cmtime); -#else - tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime); -#endif + tw_process_page(s, sock, tw_http_status(200), mime, f, NULL, st.st_size, st.st_mtime, cmtime); fclose(f); } } @@ -967,7 +964,6 @@ cleanup: close_socket(sock); #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || defined(__WATCOMC__) #ifdef __NETWARE__ - pthread_exit(NULL); #else _endthread(); #endif @@ -1078,9 +1074,7 @@ void tw_server_loop(void) { #ifdef __OS2__ _beginthread(tw_server_pass, 0, 0, e); #elif defined(__NETWARE__) - pthread_t thr; - pthread_create(&thr, NULL, (void* (*)(void*))tw_server_pass, e); - pthread_detach(thr); + tw_server_pass(e); #else _beginthread(tw_server_pass, 0, e); #endif diff --git a/Server/tw_config.h b/Server/tw_config.h index 84c2fa7..579ee4d 100644 --- a/Server/tw_config.h +++ b/Server/tw_config.h @@ -36,6 +36,18 @@ extern "C" { #endif #endif +#ifdef __NETWARE__ +struct in_addr { + uint32_t s_addr; +}; +struct sockaddr_in { + uint16_t sin_family; + uint16_t sin_port; + struct in_addr sin_addr; + uint8_t sin_zero[8]; +}; +#endif + #if defined(NO_IPV6) #define SOCKADDR struct sockaddr_in #else