Changeset 43 in Main for trunk/Server/server.c
- Timestamp:
- Sep 18, 2024, 6:19:03 PM (2 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Server/server.c
r33 r43 3 3 #define SOURCE 4 4 5 #include "../config.h" 6 5 7 #include "tw_server.h" 6 8 9 #ifndef NO_SSL 7 10 #include "tw_ssl.h" 11 #endif 12 8 13 #include "tw_config.h" 9 14 #include "tw_http.h" … … 15 20 #include <stdbool.h> 16 21 #include <stdarg.h> 22 #include <stdio.h> 23 #include <stdlib.h> 17 24 #include <sys/stat.h> 18 25 #include <time.h> … … 143 150 144 151 size_t tw_read(SSL* ssl, int s, void* data, size_t len) { 152 #ifndef NO_SSL 145 153 if(ssl == NULL) { 146 154 return recv(s, data, len, 0); … … 148 156 return SSL_read(ssl, data, len); 149 157 } 158 #else 159 return recv(s, data, len, 0); 160 #endif 150 161 } 151 162 152 163 size_t tw_write(SSL* ssl, int s, void* data, size_t len) { 164 #ifndef NO_SSL 153 165 if(ssl == NULL) { 154 166 return send(s, data, len, 0); … … 156 168 return SSL_write(ssl, data, len); 157 169 } 170 #else 171 return send(s, data, len, 0); 172 #endif 158 173 } 159 174 … … 389 404 char* name = config.hostname; 390 405 406 #ifndef NO_SSL 391 407 SSL_CTX* ctx = NULL; 392 408 SSL* s = NULL; … … 399 415 sslworks = true; 400 416 } 417 #else 418 void* s = NULL; 419 #endif 401 420 struct tw_http_request req; 402 421 struct tw_http_response res; … … 661 680 } 662 681 cleanup: 682 #ifndef NO_SSL 663 683 if(sslworks) { 664 684 SSL_shutdown(s); … … 666 686 SSL_free(s); 667 687 close_socket(sock); 688 #endif 668 689 #ifdef __MINGW32__ 669 690 _endthreadex(0); 670 691 #endif 692 ; 671 693 } 672 694
Note:
See TracChangeset
for help on using the changeset viewer.