- Timestamp:
- Sep 19, 2024, 11:33:18 PM (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/server.c
r96 r97 42 42 #include <netinet/in.h> 43 43 #include <netinet/tcp.h> 44 #endif 45 46 #ifdef __HAIKU__ 47 #include <OS.h> 44 48 #endif 45 49 … … 392 396 } 393 397 394 #ifdef __MINGW32__395 398 struct pass_entry { 396 399 int sock; … … 400 403 }; 401 404 405 #ifdef __MINGW32__ 402 406 unsigned int WINAPI tw_server_pass(void* ptr) { 407 #elif defined(__HAIKU__) 408 int32_t tw_server_pass(void* ptr) { 403 409 int sock = ((struct pass_entry*)ptr)->sock; 404 410 bool ssl = ((struct pass_entry*)ptr)->ssl; … … 802 808 int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen); 803 809 cm_log("Server", "New connection accepted"); 804 #if def __MINGW32__810 #if defined(__MINGW32__) || defined(__HAIKU__) 805 811 struct pass_entry* e = malloc(sizeof(*e)); 806 812 e->sock = sock; … … 808 814 e->port = config.ports[i]; 809 815 e->addr = claddr; 816 #endif 817 #ifdef __MINGW32__ 810 818 int j; 811 819 for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) { … … 826 834 } 827 835 } 836 #elif defined(__HAIKU__) 837 thread_id thr = spawn_Thread(tw_server_pass, "Tewi HTTPd", 60, e); 828 838 #else 829 839 pid_t pid = fork(); … … 832 842 for(j = 0; j < sockcount; j++) close_socket(sockets[j]); 833 843 tw_server_pass(sock, config.ports[i] & (1ULL << 32), config.ports[i], claddr); 834 #ifdef __HAIKU__835 exit(0);836 #else837 844 _exit(0); 838 #endif839 845 } else { 840 846 close_socket(sock);
Note:
See TracChangeset
for help on using the changeset viewer.