Check-in [a00671c11b]
Overview
Comment:Additional improvements
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:a00671c11b190935089c7fd3c02ed52f62d1e77a
User & Date: rkeene on 2014-02-05 09:04:11
Other Links: manifest | tags
Context
2014-02-05
09:06
Reverted default port changed inadvertantly and added comments check-in: 69c6325220 user: rkeene tags: trunk
09:04
Additional improvements check-in: a00671c11b user: rkeene tags: trunk
09:01
Added support for a "no logging" compile-time option (for now) and updated to support sendfile restarts check-in: c7e703e4e5 user: rkeene tags: trunk
Changes

Modified filed.c from [f27d202156] to [980ea4ded8].

   200    200   		lseek(fd, 0, SEEK_SET);
   201    201   
   202    202   		cache->fd = fd;
   203    203   		cache->len = len;
   204    204   		cache->path = strdup(path);
   205    205   
   206    206   		/* XXX:TODO: Determine */
   207         -		cache->type = "text/plain";
          207  +		cache->type = "application/octet-stream";
   208    208   		cache->lastmod = filed_format_time(cache->lastmod_b, sizeof(cache->lastmod_b), time(NULL) - 30);
   209    209   	} else {
   210    210   		filed_log_msg_debug("Cache hit for idx: %lu: PATH \"%s\"", (unsigned long) cache_idx, path);
   211    211   	}
   212    212   
   213    213   	/*
   214    214   	 * We have to make a duplicate FD, because once we release the cache
................................................................................
   283    283   	}
   284    284   
   285    285   	return(path);
   286    286   }
   287    287   
   288    288   /* Return an error page */
   289    289   static void filed_error_page(FILE *fp, const char *date_current, int error_number) {
   290         -	char *error_string = "ERROR";
          290  +	char *error_string = "<html><head><title>ERROR</title></head><body>Unable to process request</body></html>";
   291    291   
   292    292   	fprintf(fp, "HTTP/1.1 %i OK\r\nDate: %s\r\nServer: filed\r\nLast-Modified: %s\r\nContent-Length: %llu\r\nContent-Type: %s\r\nConnection: close\r\n\r\n%s",
   293    293   		error_number,
   294    294   		date_current,
   295    295   		date_current,
   296    296   		(unsigned long long) strlen(error_string),
   297    297   		"text/html",
................................................................................
   422    422   		/* Reset failure count*/
   423    423   		failure_count = 0;
   424    424   
   425    425   		/* Handle socket */
   426    426   		filed_handle_client(fd);
   427    427   	}
   428    428   
   429         -	/* XXX:TODO: Report error */
          429  +	/* Report error */
          430  +	filed_log_msg("THREAD_DIED ABNORMAL");
          431  +
   430    432   	return(NULL);
   431    433   }
   432    434   
   433    435   /* Create worker threads */
   434    436   static int filed_worker_threads_init(int fd, int thread_count) {
   435    437   	struct filed_worker_thread_args *arg;
   436    438   	pthread_t threadid;