Project

General

Profile

Feature #1293 ยป lighttpd-empty-accesslog.patch

patch -- bmaurer - Anonymous, 2007-08-08 23:53

View differences:

mod_accesslog.c (working copy)
27 27
# include <syslog.h>
28 28
#endif
29 29

  
30
#define DEV_NULL_FD (-1)
31

  
30 32
typedef struct {
31 33
	char key;
32 34
	enum {
......
475 477

  
476 478
		if (buffer_is_empty(s->access_logfile)) continue;
477 479

  
480
		if ('\0' == s->access_logfile->ptr[0]) {
481
			s->log_access_fd = DEV_NULL_FD;
482
			continue;
483
		}
484

  
478 485
		if (s->access_logfile->ptr[0] == '|') {
479 486
#ifdef HAVE_FORK
480 487
			/* create write pipe and spawn process */
......
571 578

  
572 579
		if (s->use_syslog == 0 &&
573 580
		    !buffer_is_empty(s->access_logfile) &&
574
		    s->access_logfile->ptr[0] != '|') {
581
		    s->access_logfile->ptr[0] != '|' &&
582
		    s->log_access_fd != DEV_NULL_FD) {
575 583

  
576 584
			close(s->log_access_fd);
577 585

  
......
647 655

  
648 656
	mod_accesslog_patch_connection(srv, con, p);
649 657

  
658
	if ((p->conf.use_syslog == 0) && p->conf.log_access_fd == DEV_NULL_FD) {
659
		return HANDLER_GO_ON;
660
	}
661

  
650 662
	b = p->conf.access_logbuffer;
651 663
	if (b->used == 0) {
652 664
		buffer_copy_string(b, "");
    (1-1/1)