|
@@ -139,11 +139,8 @@ mg_static_assert(sizeof(void *) >= sizeof(int), "data type size check");
|
|
|
* Symbian is no longer maintained since 2014-01-01.
|
|
|
* Recent versions of CivetWeb are no longer tested for Symbian.
|
|
|
* It makes no sense, to support an abandoned operating system.
|
|
|
- * All remaining "#ifdef __SYMBIAN__" cases will be dropped from
|
|
|
- * the code sooner or later.
|
|
|
*/
|
|
|
-#pragma message \
|
|
|
- "Symbian is no longer maintained. CivetWeb will drop Symbian support."
|
|
|
+#error "Symbian is no longer maintained. CivetWeb no longer supports Symbian."
|
|
|
#define NO_SSL /* SSL is not supported */
|
|
|
#define NO_CGI /* CGI is not supported */
|
|
|
#define PATH_MAX FILENAME_MAX
|
|
@@ -424,8 +421,8 @@ mg_static_assert(MAX_WORKER_THREADS >= 1,
|
|
|
mg_static_assert(sizeof(size_t) == 4 || sizeof(size_t) == 8,
|
|
|
"size_t data type size check");
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__) /* WINDOWS include block */
|
|
|
-#include <winsock2.h> /* DTL add for SO_EXCLUSIVE */
|
|
|
+#if defined(_WIN32) /* WINDOWS include block */
|
|
|
+#include <winsock2.h> /* DTL add for SO_EXCLUSIVE */
|
|
|
#include <ws2tcpip.h>
|
|
|
#include <windows.h>
|
|
|
|
|
@@ -730,8 +727,7 @@ struct pollfd {
|
|
|
#pragma comment(lib, "Ws2_32.lib")
|
|
|
#endif
|
|
|
|
|
|
-#else /* defined(_WIN32) && !defined(__SYMBIAN32__) - \
|
|
|
- WINDOWS / UNIX include block */
|
|
|
+#else /* defined(_WIN32) - WINDOWS vs UNIX include block */
|
|
|
|
|
|
#include <sys/wait.h>
|
|
|
#include <sys/socket.h>
|
|
@@ -805,8 +801,7 @@ typedef int SOCKET;
|
|
|
#define socklen_t int
|
|
|
#endif /* hpux */
|
|
|
|
|
|
-#endif /* defined(_WIN32) && !defined(__SYMBIAN32__) - \
|
|
|
- WINDOWS / UNIX include block */
|
|
|
+#endif /* defined(_WIN32) - WINDOWS vs UNIX include block */
|
|
|
|
|
|
|
|
|
/* In case our C library is missing "timegm", provide an implementation */
|
|
@@ -1128,7 +1123,7 @@ stat(const char *name, struct stat *st)
|
|
|
static pthread_mutex_t global_lock_mutex;
|
|
|
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
/* Forward declaration for Windows */
|
|
|
FUNCTION_MAY_BE_UNUSED
|
|
|
static int pthread_mutex_lock(pthread_mutex_t *mutex);
|
|
@@ -1159,7 +1154,7 @@ static int
|
|
|
mg_atomic_inc(volatile int *addr)
|
|
|
{
|
|
|
int ret;
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__) && !defined(NO_ATOMICS)
|
|
|
+#if defined(_WIN32) && !defined(NO_ATOMICS)
|
|
|
/* Depending on the SDK, this function uses either
|
|
|
* (volatile unsigned int *) or (volatile LONG *),
|
|
|
* so whatever you use, the other SDK is likely to raise a warning. */
|
|
@@ -1182,7 +1177,7 @@ static int
|
|
|
mg_atomic_dec(volatile int *addr)
|
|
|
{
|
|
|
int ret;
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__) && !defined(NO_ATOMICS)
|
|
|
+#if defined(_WIN32) && !defined(NO_ATOMICS)
|
|
|
/* Depending on the SDK, this function uses either
|
|
|
* (volatile unsigned int *) or (volatile LONG *),
|
|
|
* so whatever you use, the other SDK is likely to raise a warning. */
|
|
@@ -1205,7 +1200,7 @@ static int64_t
|
|
|
mg_atomic_add(volatile int64_t *addr, int64_t value)
|
|
|
{
|
|
|
int64_t ret;
|
|
|
-#if defined(_WIN64) && !defined(__SYMBIAN32__) && !defined(NO_ATOMICS)
|
|
|
+#if defined(_WIN64) && !defined(NO_ATOMICS)
|
|
|
ret = InterlockedAdd64(addr, value);
|
|
|
#elif defined(__GNUC__) \
|
|
|
&& ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 0))) \
|
|
@@ -1543,7 +1538,7 @@ static int thread_idx_max = 0;
|
|
|
struct mg_workerTLS {
|
|
|
int is_master;
|
|
|
unsigned long thread_idx;
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
HANDLE pthread_cond_helper_mutex;
|
|
|
struct mg_workerTLS *next_waiting_thread;
|
|
|
#endif
|
|
@@ -4792,7 +4787,7 @@ mg_send_http_redirect(struct mg_connection *conn,
|
|
|
}
|
|
|
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
/* Create substitutes for POSIX functions in Win32. */
|
|
|
|
|
|
#if defined(__MINGW32__)
|
|
@@ -17613,7 +17608,7 @@ worker_thread_run(struct worker_thread_args *thread_args)
|
|
|
|
|
|
tls.is_master = 0;
|
|
|
tls.thread_idx = (unsigned)mg_atomic_inc(&thread_idx_max);
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
tls.pthread_cond_helper_mutex = CreateEvent(NULL, FALSE, FALSE, NULL);
|
|
|
#endif
|
|
|
|
|
@@ -17747,7 +17742,7 @@ worker_thread_run(struct worker_thread_args *thread_args)
|
|
|
|
|
|
|
|
|
pthread_setspecific(sTlsKey, NULL);
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
CloseHandle(tls.pthread_cond_helper_mutex);
|
|
|
#endif
|
|
|
pthread_mutex_destroy(&conn->mutex);
|
|
@@ -17911,7 +17906,7 @@ master_thread_run(void *thread_func_param)
|
|
|
#endif
|
|
|
|
|
|
/* Initialize thread local storage */
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
tls.pthread_cond_helper_mutex = CreateEvent(NULL, FALSE, FALSE, NULL);
|
|
|
#endif
|
|
|
tls.is_master = 1;
|
|
@@ -17994,7 +17989,7 @@ master_thread_run(void *thread_func_param)
|
|
|
|
|
|
DEBUG_TRACE("%s", "exiting");
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
CloseHandle(tls.pthread_cond_helper_mutex);
|
|
|
#endif
|
|
|
pthread_setspecific(sTlsKey, NULL);
|
|
@@ -18151,9 +18146,9 @@ mg_stop(struct mg_context *ctx)
|
|
|
mg_join_thread(mt);
|
|
|
free_context(ctx);
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
(void)WSACleanup();
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif /* _WIN32 */
|
|
|
}
|
|
|
|
|
|
|
|
@@ -18223,10 +18218,10 @@ mg_start(const struct mg_callbacks *callbacks,
|
|
|
|
|
|
struct mg_workerTLS tls;
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
WSADATA data;
|
|
|
WSAStartup(MAKEWORD(2, 2), &data);
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif /* _WIN32 */
|
|
|
|
|
|
/* Allocate context and initialize reasonable general case defaults. */
|
|
|
if ((ctx = (struct mg_context *)mg_calloc(1, sizeof(*ctx))) == NULL) {
|
|
@@ -18267,7 +18262,7 @@ mg_start(const struct mg_callbacks *callbacks,
|
|
|
|
|
|
tls.is_master = -1;
|
|
|
tls.thread_idx = (unsigned)mg_atomic_inc(&thread_idx_max);
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
tls.pthread_cond_helper_mutex = NULL;
|
|
|
#endif
|
|
|
pthread_setspecific(sTlsKey, &tls);
|
|
@@ -18788,7 +18783,6 @@ mg_get_system_info_impl(char *buffer, int buflen)
|
|
|
/* System info */
|
|
|
{
|
|
|
#if defined(_WIN32)
|
|
|
-#if !defined(__SYMBIAN32__)
|
|
|
DWORD dwVersion = 0;
|
|
|
DWORD dwMajorVersion = 0;
|
|
|
DWORD dwMinorVersion = 0;
|
|
@@ -18835,14 +18829,6 @@ mg_get_system_info_impl(char *buffer, int buflen)
|
|
|
if (system_info_length < buflen) {
|
|
|
strcat0(buffer, block);
|
|
|
}
|
|
|
-
|
|
|
-#else
|
|
|
- mg_snprintf(NULL, NULL, block, sizeof(block), "%s - Symbian%s", eol);
|
|
|
- system_info_length += (int)strlen(block);
|
|
|
- if (system_info_length < buflen) {
|
|
|
- strcat0(buffer, block);
|
|
|
- }
|
|
|
-#endif
|
|
|
#else
|
|
|
struct utsname name;
|
|
|
memset(&name, 0, sizeof(name));
|
|
@@ -19643,9 +19629,9 @@ mg_init_library(unsigned features)
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
InitializeCriticalSection(&global_log_file_lock);
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif
|
|
|
#if !defined(_WIN32)
|
|
|
pthread_mutexattr_init(&pthread_mutex_attr);
|
|
|
pthread_mutexattr_settype(&pthread_mutex_attr, PTHREAD_MUTEX_RECURSIVE);
|
|
@@ -19677,10 +19663,10 @@ mg_init_library(unsigned features)
|
|
|
/* Start WinSock for Windows */
|
|
|
mg_global_lock();
|
|
|
if (mg_init_library_called <= 0) {
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
WSADATA data;
|
|
|
WSAStartup(MAKEWORD(2, 2), &data);
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif /* _WIN32 */
|
|
|
mg_init_library_called = 1;
|
|
|
} else {
|
|
|
mg_init_library_called++;
|
|
@@ -19703,9 +19689,9 @@ mg_exit_library(void)
|
|
|
|
|
|
mg_init_library_called--;
|
|
|
if (mg_init_library_called == 0) {
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
(void)WSACleanup();
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif /* _WIN32 */
|
|
|
#if !defined(NO_SSL)
|
|
|
if (mg_ssl_initialized) {
|
|
|
uninitialize_ssl();
|
|
@@ -19713,9 +19699,9 @@ mg_exit_library(void)
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
-#if defined(_WIN32) && !defined(__SYMBIAN32__)
|
|
|
+#if defined(_WIN32)
|
|
|
(void)DeleteCriticalSection(&global_log_file_lock);
|
|
|
-#endif /* _WIN32 && !__SYMBIAN32__ */
|
|
|
+#endif /* _WIN32 */
|
|
|
#if !defined(_WIN32)
|
|
|
(void)pthread_mutexattr_destroy(&pthread_mutex_attr);
|
|
|
#endif
|