Changeset 105 in Main for trunk/Server/server.c
- Timestamp:
- Sep 20, 2024, 10:08:44 PM (8 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/server.c
r104 r105 407 407 #elif defined(__HAIKU__) 408 408 int32_t tw_server_pass(void* ptr) { 409 #endif 410 #if defined(__HAIKU__) || defined(__MINGW32__) 409 411 int sock = ((struct pass_entry*)ptr)->sock; 410 412 bool ssl = ((struct pass_entry*)ptr)->ssl; … … 413 415 free(ptr); 414 416 #else 415 void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) {417 void tw_server_pass(int sock, bool ssl, int port, SOCKADDR addr) { 416 418 #endif 417 419 char* name = config.hostname; … … 429 431 } 430 432 #else 431 void* s = NULL;433 void* s = NULL; 432 434 #endif 433 435 struct tw_http_request req; … … 455 457 cmtime -= (btm->tm_hour * 60 + btm->tm_min) * 60; 456 458 #else 457 cmtime = timegm(&tm);459 cmtime = timegm(&tm); 458 460 #endif 459 461 } … … 740 742 _endthreadex(0); 741 743 #elif defined(__HAIKU__) 742 exit_thread(0);744 exit_thread(0); 743 745 #endif 744 746 ; … … 780 782 int ret = select(32, &fdset, NULL, NULL, &tv); 781 783 #else 782 int ret = select(FD_SETSIZE, &fdset, NULL, NULL, &tv);784 int ret = select(FD_SETSIZE, &fdset, NULL, NULL, &tv); 783 785 #endif 784 786 if(ret == -1) { … … 829 831 } 830 832 #elif defined(__HAIKU__) 831 int j; 832 for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) { 833 if(threads[j].used) { 834 thread_info info; 835 bool kill = false; 836 if(get_thread_info(threads[j].thread, &info) == B_OK) { 837 } else { 838 kill = true; 839 } 840 if(kill) { 841 threads[j].used = false; 833 int j; 834 for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) { 835 if(threads[j].used) { 836 thread_info info; 837 bool kill = false; 838 if(get_thread_info(threads[j].thread, &info) == B_OK) { 839 } else { 840 kill = true; 841 } 842 if(kill) { 843 threads[j].used = false; 844 } 842 845 } 843 846 } 844 }845 for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) {846 if(!threads[j].used) {847 threads[j].thread = spawn_thread(tw_server_pass, "Tewi HTTPd", 60, e);848 threads[j].used = true;849 resume_thread(threads[j].thread);850 break;847 for(j = 0; j < sizeof(threads) / sizeof(threads[0]); j++) { 848 if(!threads[j].used) { 849 threads[j].thread = spawn_thread(tw_server_pass, "Tewi HTTPd", 60, e); 850 threads[j].used = true; 851 resume_thread(threads[j].thread); 852 break; 853 } 851 854 } 852 }853 855 #else 854 856 pid_t pid = fork();
Note:
See TracChangeset
for help on using the changeset viewer.