Overview
Comment: | Updated to use a thread-local variable for dummy log entries to avoid potential issues |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: | b8d631487085c81da51c438405cf74aadbaa95cc |
User & Date: | rkeene on 2014-02-11 04:39:51 |
Other Links: | manifest | tags |
Context
2014-02-11
| ||
04:40 | Re-enabled logging in default build, accidentally disabled check-in: 2334e712aa user: rkeene tags: trunk | |
04:39 | Updated to use a thread-local variable for dummy log entries to avoid potential issues check-in: b8d6314870 user: rkeene tags: trunk | |
04:32 | Whitespace fix check-in: bbd721a8cc user: rkeene tags: trunk | |
Changes
Modified Makefile from [a294b2122c] to [a724394795].
1 2 3 4 5 6 7 8 9 |
CC = gcc CFLAGS = -Wall -Werror -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE LDFLAGS = -pthread LIBS = -lpthread MIMETYPES = /etc/httpd/mime.types PREFIX = /usr/local prefix = $(PREFIX) bindir = $(prefix)/bin |
| |
1 2 3 4 5 6 7 8 9 |
CC = gcc
CFLAGS = -Wall -Werror -W -pthread -O3 -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DFILED_DONT_LOG=1
LDFLAGS = -pthread
LIBS = -lpthread
MIMETYPES = /etc/httpd/mime.types
PREFIX = /usr/local
prefix = $(PREFIX)
bindir = $(prefix)/bin
|
Modified filed.c from [776212fe50] to [8b7ede8efd].
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 ... 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 ... 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 |
} return(fd); } /* Log a message */ #ifdef FILED_DONT_LOG struct filed_log_entry filed_dummy_log_entry; # define filed_logging_thread_init(x) 0 # define filed_log_msg_debug(x, ...) /**/ # define filed_log_msg(x, ...) /**/ # define filed_log_entry(x) /**/ # define filed_log_ip(x, ...) NULL # define filed_log_new(x) &filed_dummy_log_entry #else # ifdef FILED_DEBUG # define filed_log_msg_debug(x, ...) { fprintf(stderr, x, __VA_ARGS__); fprintf(stderr, "\n"); fflush(stderr); } # else # define filed_log_msg_debug(x, ...) /**/ # endif ................................................................................ return; } /* Handle incoming connections */ static void *filed_worker_thread(void *arg_v) { struct filed_worker_thread_args *arg; struct filed_http_request request; struct filed_log_entry *log; struct sockaddr_in6 addr; char logbuf_ip[128]; socklen_t addrlen; int failure_count = 0, max_failure_count = FILED_MAX_FAILURE_COUNT; int master_fd, fd; /* Read arguments */ arg = arg_v; ................................................................................ } /* Report error */ filed_log_msg("THREAD_DIED ABNORMAL"); return(NULL); /* Make compiler happy */ logbuf_ip[0] = '\0'; logbuf_ip[0] = logbuf_ip[0]; } /* Create worker threads */ static int filed_worker_threads_init(int fd, int thread_count) { struct filed_worker_thread_args *arg; pthread_t threadid; int pthread_ret; |
< | | < | | | < |
226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 ... 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 ... 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 |
} return(fd); } /* Log a message */ #ifdef FILED_DONT_LOG # define filed_logging_thread_init(x) 0 # define filed_log_msg_debug(x, ...) /**/ # define filed_log_msg(x, ...) /**/ # define filed_log_entry(x) /**/ # define filed_log_ip(x, ...) NULL # define filed_log_new(x) &local_dummy_log #else # ifdef FILED_DEBUG # define filed_log_msg_debug(x, ...) { fprintf(stderr, x, __VA_ARGS__); fprintf(stderr, "\n"); fflush(stderr); } # else # define filed_log_msg_debug(x, ...) /**/ # endif ................................................................................ return; } /* Handle incoming connections */ static void *filed_worker_thread(void *arg_v) { struct filed_worker_thread_args *arg; struct filed_http_request request; struct filed_log_entry *log, local_dummy_log; struct sockaddr_in6 addr; socklen_t addrlen; int failure_count = 0, max_failure_count = FILED_MAX_FAILURE_COUNT; int master_fd, fd; /* Read arguments */ arg = arg_v; ................................................................................ } /* Report error */ filed_log_msg("THREAD_DIED ABNORMAL"); return(NULL); /* local_dummy_log is only used if FILED_DONT_LOG is anebled, otherwise it's not used, but the compiler hates that idea. */ local_dummy_log.type = 0; local_dummy_log.type = local_dummy_log.type; } /* Create worker threads */ static int filed_worker_threads_init(int fd, int thread_count) { struct filed_worker_thread_args *arg; pthread_t threadid; int pthread_ret; |