Index: filed.c
==================================================================
--- filed.c
+++ filed.c
@@ -429,11 +429,10 @@
int range_request;
int fd;
int i;
fd = fileno(fp);
- fd = fd;
range_start = 0;
range_end = 0;
range_request = 0;
range_length = -1;
@@ -529,10 +528,13 @@
buffer_st->headers.range.present = range_request;
buffer_st->headers.range.offset = range_start;
buffer_st->headers.range.length = range_length;
return(buffer_st);
+
+ /* Make compiler happy */
+ fd = fd;
}
/* Return an error page */
static void filed_error_page(FILE *fp, const char *date_current, int error_number) {
char *error_string = "
ERRORUnable to process request";
@@ -751,11 +753,11 @@
/* Handle incoming connections */
static void *filed_worker_thread(void *arg_v) {
struct filed_worker_thread_args *arg;
struct filed_http_request request;
struct sockaddr_in6 addr;
- char logbuf[128];
+ char logbuf_ip[128];
socklen_t addrlen;
int failure_count = 0, max_failure_count = MAX_FAILURE_COUNT;
int master_fd, fd;
/* Read arguments */
@@ -785,13 +787,15 @@
continue;
}
/* Log the new connection */
- logbuf[0]='\0';
- inet_ntop(AF_INET6, &addr.sin6_addr, logbuf, sizeof(logbuf));
- filed_log_msg("NEW_CONNECTION SRC_ADDR=%s SRC_PORT=%lu FD=%i", logbuf, (unsigned long) addr.sin6_port, fd);
+ filed_log_msg("NEW_CONNECTION SRC_ADDR=%s SRC_PORT=%lu FD=%i",
+ inet_ntop(AF_INET6, &addr.sin6_addr, logbuf_ip, sizeof(logbuf_ip)) ? logbuf_ip : "",
+ (unsigned long) addr.sin6_port,
+ fd
+ );
/* Reset failure count*/
failure_count = 0;
/* Handle socket */
@@ -800,10 +804,15 @@
/* 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;