Subversion Repositories Tewi

Rev

Rev 212 | Rev 240 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 212 Rev 215
Line 1... Line 1...
1
/* $Id: config.c 212 2024-10-02 17:44:55Z nishi $ */
1
/* $Id: config.c 215 2024-10-02 19:24:43Z nishi $ */
2
 
2
 
3
#define SOURCE
3
#define SOURCE
4
 
4
 
5
#include "tw_config.h"
5
#include "tw_config.h"
6
#include "tw_module.h"
6
#include "tw_module.h"
Line 8... Line 8...
8
#include <stdio.h>
8
#include <stdio.h>
9
#include <stdint.h>
9
#include <stdint.h>
10
#include <stdlib.h>
10
#include <stdlib.h>
11
#include <string.h>
11
#include <string.h>
12
 
12
 
13
#ifndef _MSC_VER
13
#if !defined(_MSC_VER) && !defined(__BORLANDC__)
14
#include <unistd.h>
14
#include <unistd.h>
15
#endif
15
#endif
16
 
16
 
17
#if defined(__MINGW32__) || defined(_MSC_VER)
17
#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)
18
#include <winsock2.h>
18
#include <winsock2.h>
19
#endif
19
#endif
20
 
20
 
21
#include <cm_string.h>
21
#include <cm_string.h>
22
#include <cm_log.h>
22
#include <cm_log.h>
Line 264... Line 264...
264
#ifndef NO_SSL
264
#ifndef NO_SSL
265
						  || cm_strcaseequ(r[0], "ListenSSL")
265
						  || cm_strcaseequ(r[0], "ListenSSL")
266
#endif
266
#endif
267
					) {
267
					) {
268
						for(i = 1; r[i] != NULL; i++) {
268
						for(i = 1; r[i] != NULL; i++) {
269
#ifdef _MSC_VER
269
#if defined(_MSC_VER) || defined(__BORLANDC__)
270
							uint32_t port = atoi(r[i]);
270
							uint32_t port = atoi(r[i]);
271
#else
271
#else
272
							uint64_t port = atoi(r[i]);
272
							uint64_t port = atoi(r[i]);
273
#endif
273
#endif
274
							int j;
274
							int j;
275
							cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : "");
275
							cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : "");
276
#ifdef _MSC_VER
276
#if defined(_MSC_VER) || defined(__BORLANDC__)
277
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1UL << 31);
277
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1UL << 31);
278
#else
278
#else
279
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 31);
279
							if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 31);
280
#endif
280
#endif
281
							for(j = 0; config.ports[j] != -1; j++)
281
							for(j = 0; config.ports[j] != -1; j++)