]> Nishi Git Mirror - tewi.git/commitdiff
fix some stuff
authorNishi <nishi@nishi.boats>
Tue, 15 Oct 2024 20:08:08 +0000 (20:08 +0000)
committerNishi <nishi@nishi.boats>
Tue, 15 Oct 2024 20:08:08 +0000 (20:08 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@349 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/config.c
Server/http.c
Server/main.c
Server/module.c
Server/server.c
Server/tw_config.h

index 00fa104d2ed80ffbb60c9e5c2934f5a9e371f691..53d860ea7e4ed0c48e11f70bcf6fedb063b0d133 100644 (file)
@@ -32,7 +32,7 @@
 #endif
 
 #ifdef __NETWARE__
-#include <arpa/inet.h>
+#include <sys/socket.h>
 #endif
 #include "tw_config.h"
 #include "tw_module.h"
index 94dacf99029989e3070c6266cb8e62eedfab49eb..cf74139dfa5431dacd171df46491756a626b88a5 100644 (file)
@@ -29,7 +29,6 @@
 #endif
 #elif defined(__NETWARE__)
 #include <sys/socket.h>
-#include <sys/select.h>
 #else
 #ifdef USE_POLL
 #ifdef __PPU__
index f6b9fbc75e98a71181cb2bf213b425c62616bcb8..2400b33656cb5bdc6dc0e1bbc024c03ae884165b 100644 (file)
@@ -37,8 +37,6 @@
 #if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) || (defined(__WATCOMC__) && !defined(__OS2__) && !defined(__NETWARE__))
 #include <windows.h>
 #elif defined(__NETWARE__)
-#include <nks/thread.h>
-#include <screen.h>
 #endif
 
 #ifdef _PSP
index 50c29b46fe59801913abaafd8e9bbac938ce2415..8ebd3952774d7739a1c0c907fb4f259d344e2c73 100644 (file)
@@ -32,7 +32,8 @@ int tw_module_init(void* mod) { return 1; }
 #define INCL_DOSERRORS
 #include <os2.h>
 #elif defined(__NETWARE__)
-#include <dlfcn.h>
+#include <nwadv.h>
+#include <nwthread.h>
 #else
 #include <windows.h>
 #include <direct.h>
@@ -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
index 58fdf3aff35a888f0e00db1107ce6fccffa997b9..7a4247477ae2e26ecd34f206b97f40c5bf36b66b 100644 (file)
@@ -64,11 +64,12 @@ typedef int socklen_t;
 typedef int socklen_t;
 #elif defined(__NETWARE__)
 #include <sys/socket.h>
-#include <arpa/inet.h>
-#include <sys/select.h>
-#include <pthread.h>
+
+#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
index 84c2fa778c84707cf2e3457e83074d361b76e914..579ee4d7124c90a95441dba24c85b2d1be2cdd01 100644 (file)
@@ -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