SOURCES: lighttpd-mod_deflate.patch - update from http://trac.lighttpd.net/...

glen glen at pld-linux.org
Mon Jul 28 18:03:50 CEST 2008


Author: glen                         Date: Mon Jul 28 16:03:50 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- update from http://trac.lighttpd.net/trac/raw-attachment/wiki/Mod_Deflate/lighttpd-1.4.19.mod_deflate.patch

---- Files affected:
SOURCES:
   lighttpd-mod_deflate.patch (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/lighttpd-mod_deflate.patch
diff -u SOURCES/lighttpd-mod_deflate.patch:1.1 SOURCES/lighttpd-mod_deflate.patch:1.2
--- SOURCES/lighttpd-mod_deflate.patch:1.1	Sun Feb 19 10:51:19 2006
+++ SOURCES/lighttpd-mod_deflate.patch	Mon Jul 28 18:03:45 2008
@@ -1,58 +1,60 @@
-diff -Naur lighttpd-1.4.10.orig/src/Makefile.am lighttpd-1.4.10/src/Makefile.am
---- lighttpd-1.4.10.orig/src/Makefile.am	2006-01-04 06:08:03.000000000 -0800
-+++ lighttpd-1.4.10/src/Makefile.am	2006-02-16 22:25:16.504347041 -0800
-@@ -28,7 +28,7 @@
- mod_ssi_expr.c: mod_ssi_exprparser.h
- 
- common_src=buffer.c log.c \
--      keyvalue.c chunk.c  \
-+      keyvalue.c chunk.c chunk_encode.c \
-       http_chunk.c stream.c fdevent.c \
-       stat_cache.c plugin.c joblist.c etag.c array.c \
-       data_string.c data_count.c data_array.c \
-@@ -222,9 +222,14 @@
- mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
- mod_accesslog_la_LIBADD = $(common_libadd)
+diff -Naur lighttpd-1.4.19/configure.in lighttpd-1.4.19.mod_deflate.jz/configure.in
+--- lighttpd-1.4.19/configure.in
++++ lighttpd-1.4.19.mod_deflate.jz/configure.in
+@@ -558,7 +558,7 @@
+ AC_OUTPUT
  
-+lib_LTLIBRARIES += mod_deflate.la
-+mod_deflate_la_SOURCES = mod_deflate.c 
-+mod_deflate_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
-+mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
-+
  
- hdr = server.h buffer.h network.h log.h keyvalue.h \
--      response.h request.h fastcgi.h chunk.h \
-+      response.h request.h fastcgi.h chunk.h chunk_encode.h \
-       settings.h http_chunk.h http_auth_digest.h \
-       md5.h http_auth.h stream.h \
-       fdevent.h connections.h base.h stat_cache.h \
-diff -Naur lighttpd-1.4.10.orig/src/base.h lighttpd-1.4.10/src/base.h
---- lighttpd-1.4.10.orig/src/base.h	2006-01-11 06:51:04.000000000 -0800
-+++ lighttpd-1.4.10/src/base.h	2006-02-16 22:25:16.504347041 -0800
-@@ -345,8 +345,10 @@
- 	
+-do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfiles mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming"
++do_build="mod_cgi mod_fastcgi mod_extforward mod_proxy mod_evhost mod_simple_vhost mod_access mod_alias mod_setenv mod_usertrack mod_auth mod_status mod_accesslog mod_rrdtool mod_secdownload mod_expire mod_compress mod_dirlisting mod_indexfiles mod_userdir mod_webdav mod_staticfile mod_scgi mod_flv_streaming mod_deflate"
+ 
+ plugins="mod_rewrite mod_redirect mod_ssi mod_trigger_b4_dl"
+ features="regex-conditionals"
+diff -Naur lighttpd-1.4.19/src/base.h lighttpd-1.4.19.mod_deflate.jz/src/base.h
+--- lighttpd-1.4.19/src/base.h
++++ lighttpd-1.4.19.mod_deflate.jz/src/base.h
+@@ -149,6 +149,7 @@
+ 
+ 	http_method_t  http_method;
+ 	http_version_t http_version;
++	int true_http_10_client;
+ 
+ 	buffer *request_line;
+ 
+@@ -360,8 +361,10 @@
+ 
  	int file_started;
  	int file_finished;
 +	int end_chunk; /* used for chunked transfer encoding. */
- 	
+ 
 -	chunkqueue *write_queue;      /* a large queue for low-level write ( HTTP response ) [ file, mem ] */
 +	chunkqueue *write_queue;  /* a large queue for HTTP response content [ file, mem ] */
 +	chunkqueue *output_queue; /* a large queue for low-level write ( HTTP response ) [ file, mem ] */
  	chunkqueue *read_queue;       /* a small queue for low-level read ( HTTP request ) [ mem ] */
  	chunkqueue *request_content_queue; /* takes request-content into tempfile if necessary [ tempfile, mem ]*/
- 	
-@@ -570,6 +572,7 @@
- 	
+ 
+@@ -596,6 +599,7 @@
+ 
  	connections *conns;
  	connections *joblist;
 +	connections *joblist_prev;
  	connections *fdwaitqueue;
- 	
+ 
  	stat_cache  *stat_cache;
-diff -Naur lighttpd-1.4.10.orig/src/chunk.c lighttpd-1.4.10/src/chunk.c
---- lighttpd-1.4.10.orig/src/chunk.c	2005-11-18 05:18:19.000000000 -0800
-+++ lighttpd-1.4.10/src/chunk.c	2006-02-16 22:25:16.505346873 -0800
-@@ -224,6 +224,16 @@
+diff -Naur lighttpd-1.4.19/src/chunk.c lighttpd-1.4.19.mod_deflate.jz/src/chunk.c
+--- lighttpd-1.4.19/src/chunk.c
++++ lighttpd-1.4.19.mod_deflate.jz/src/chunk.c
+@@ -16,7 +16,9 @@
+ #include <errno.h>
+ #include <string.h>
+ 
++#include "server.h"
+ #include "chunk.h"
++#include "log.h"
+ 
+ chunkqueue *chunkqueue_init(void) {
+ 	chunkqueue *cq;
+@@ -241,6 +243,16 @@
  	return 0;
  }
  
@@ -68,44 +70,18 @@
 +
  buffer * chunkqueue_get_prepend_buffer(chunkqueue *cq) {
  	chunk *c;
- 	
-diff -Naur lighttpd-1.4.10.orig/src/chunk.h lighttpd-1.4.10/src/chunk.h
---- lighttpd-1.4.10.orig/src/chunk.h	2005-10-31 23:32:21.000000000 -0800
-+++ lighttpd-1.4.10/src/chunk.h	2006-02-16 22:25:16.505346873 -0800
-@@ -51,6 +51,7 @@
- int chunkqueue_append_file(chunkqueue *c, buffer *fn, off_t offset, off_t len);
- int chunkqueue_append_mem(chunkqueue *c, const char *mem, size_t len);
- int chunkqueue_append_buffer(chunkqueue *c, buffer *mem);
-+int chunkqueue_append_chunkqueue(chunkqueue *cq, chunkqueue *src);
- int chunkqueue_prepend_buffer(chunkqueue *c, buffer *mem);
  
- buffer * chunkqueue_get_append_buffer(chunkqueue *c);
-diff -Naur lighttpd-1.4.10.orig/src/chunk_encode.c lighttpd-1.4.10/src/chunk_encode.c
---- lighttpd-1.4.10.orig/src/chunk_encode.c	1969-12-31 16:00:00.000000000 -0800
-+++ lighttpd-1.4.10/src/chunk_encode.c	2006-02-16 22:25:16.505346873 -0800
-@@ -0,0 +1,117 @@
+@@ -400,3 +412,105 @@
+ 
+ 	return 0;
+ }
++
 +/**
 + * the HTTP chunk-API
 + * 
 + * 
 + */
 +
-+#include <sys/types.h>
-+#include <sys/stat.h>
-+
-+#include <stdlib.h>
-+#include <fcntl.h>
-+#include <unistd.h>
-+
-+#include <stdio.h>
-+#include <errno.h>
-+#include <string.h>
-+
-+#include "server.h"
-+#include "chunk.h"
-+#include "chunk_encode.h"
-+#include "log.h"
-+
 +static int chunk_encode_append_len(chunkqueue *cq, size_t len) {
 +	size_t i, olen = len, j;
 +	buffer *b;
@@ -201,31 +177,36 @@
 +	return 0;
 +}
 +
-diff -Naur lighttpd-1.4.10.orig/src/chunk_encode.h lighttpd-1.4.10/src/chunk_encode.h
---- lighttpd-1.4.10.orig/src/chunk_encode.h	1969-12-31 16:00:00.000000000 -0800
-+++ lighttpd-1.4.10/src/chunk_encode.h	2006-02-16 22:25:16.506346704 -0800
-@@ -0,0 +1,13 @@
-+#ifndef _CHUNK_ENCODE_H_
-+#define _CHUNK_ENCODE_H_
-+
-+#include "server.h"
-+#include <sys/types.h>
-+
+diff -Naur lighttpd-1.4.19/src/chunk.h lighttpd-1.4.19.mod_deflate.jz/src/chunk.h
+--- lighttpd-1.4.19/src/chunk.h
++++ lighttpd-1.4.19.mod_deflate.jz/src/chunk.h
+@@ -52,6 +52,7 @@
+ int chunkqueue_append_mem(chunkqueue *c, const char *mem, size_t len);
+ int chunkqueue_append_buffer(chunkqueue *c, buffer *mem);
+ int chunkqueue_append_buffer_weak(chunkqueue *c, buffer *mem);
++int chunkqueue_append_chunkqueue(chunkqueue *cq, chunkqueue *src);
+ int chunkqueue_prepend_buffer(chunkqueue *c, buffer *mem);
+ 
+ buffer * chunkqueue_get_append_buffer(chunkqueue *c);
+@@ -67,4 +68,10 @@
+ 
+ int chunkqueue_is_empty(chunkqueue *c);
+ 
 +int chunk_encode_append_mem(chunkqueue *cq, const char * mem, size_t len);
 +int chunk_encode_append_buffer(chunkqueue *cq, buffer *mem);
 +int chunk_encode_append_file(chunkqueue *cq, buffer *fn, off_t offset, off_t len);
 +int chunk_encode_append_queue(chunkqueue *cq, chunkqueue *src);
 +int chunk_encode_end(chunkqueue *cq);
 +
-+#endif
-diff -Naur lighttpd-1.4.10.orig/src/connections.c lighttpd-1.4.10/src/connections.c
---- lighttpd-1.4.10.orig/src/connections.c	2006-02-08 04:27:20.000000000 -0800
-+++ lighttpd-1.4.10/src/connections.c	2006-02-16 22:25:16.507346536 -0800
+ #endif
+diff -Naur lighttpd-1.4.19/src/connections.c lighttpd-1.4.19.mod_deflate.jz/src/connections.c
+--- lighttpd-1.4.19/src/connections.c
++++ lighttpd-1.4.19.mod_deflate.jz/src/connections.c
 @@ -18,6 +18,7 @@
  #include "response.h"
  #include "network.h"
  #include "http_chunk.h"
-+#include "chunk_encode.h"
++#include "chunk.h"
  #include "stat_cache.h"
  #include "joblist.h"
  
@@ -242,7 +223,7 @@
  #if 0
  static void dump_packet(const unsigned char *data, size_t len) {
  	size_t i, j;
-@@ -365,6 +372,7 @@
+@@ -405,6 +412,7 @@
  				con->file_finished = 1;
  
  				chunkqueue_reset(con->write_queue);
@@ -250,16 +231,16 @@
  			}
  			break;
  		default:
-@@ -472,12 +480,27 @@
+@@ -517,12 +525,27 @@
  		/* disable chunked encoding again as we have no body */
  		con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
+ 		con->parsed_response &= ~HTTP_CONTENT_LENGTH;
  		chunkqueue_reset(con->write_queue);
 +		chunkqueue_reset(con->output_queue);
- 		
+ 
  		con->file_finished = 1;
  		break;
  	}
- 	
  
 +	/* Allow filter plugins to change response headers before they are written. */
 +	switch(plugins_call_handle_response_start(srv, con)) {
@@ -276,17 +257,19 @@
 +	}
 +
  	if (con->file_finished) {
- 		/* we have all the content and chunked encoding is not used, set a content-length */ 
- 		
-@@ -517,6 +540,7 @@
- 	
- 	if (con->request.http_method == HTTP_METHOD_HEAD) {
+ 		/* we have all the content and chunked encoding is not used, set a content-length */
+ 
+@@ -592,8 +615,9 @@
+ 		 * without the content
+ 		 */
+ 		con->file_finished = 1;
+ 
  		chunkqueue_reset(con->write_queue);
 +		chunkqueue_reset(con->output_queue);
+ 		con->response.transfer_encoding &= ~HTTP_TRANSFER_ENCODING_CHUNKED;
  	}
  
- 	http_response_write_header(srv, con);
-@@ -525,11 +549,57 @@
+@@ -603,11 +627,57 @@
  }
  
  static int connection_handle_write(server *srv, connection *con) {
@@ -346,49 +329,52 @@
  		}
  		break;
  	case -1: /* error on our side */
-@@ -599,6 +669,7 @@
- 	
+@@ -678,6 +747,7 @@
+ 
  #undef CLEAN
  	con->write_queue = chunkqueue_init();
 +	con->output_queue = chunkqueue_init();
  	con->read_queue = chunkqueue_init();
  	con->request_content_queue = chunkqueue_init();
  	chunkqueue_set_tempdirs(con->request_content_queue, srv->srvconf.upload_tempdirs);
-@@ -627,6 +698,7 @@
+@@ -705,6 +776,7 @@
  		connection_reset(srv, con);
- 		
+ 
  		chunkqueue_free(con->write_queue);
 +		chunkqueue_free(con->output_queue);
  		chunkqueue_free(con->read_queue);
  		chunkqueue_free(con->request_content_queue);
  		array_free(con->request.headers);
-@@ -681,6 +753,7 @@
+@@ -759,7 +831,10 @@
  	con->http_status = 0;
  	con->file_finished = 0;
  	con->file_started = 0;
 +	con->end_chunk = 0;
  	con->got_response = 0;
- 	
++//	con->use_cache_file = 0;
++//	con->write_cache_file = 0;
+ 
  	con->parsed_response = 0;
-@@ -751,6 +824,7 @@
+ 
+@@ -829,6 +904,7 @@
  	array_reset(con->environment);
- 	
+ 
  	chunkqueue_reset(con->write_queue);
 +	chunkqueue_reset(con->output_queue);
  	chunkqueue_reset(con->request_content_queue);
  
- 	/* the plugins should cleanup themself */	
-@@ -1178,7 +1252,6 @@
+ 	/* the plugins should cleanup themself */
+@@ -1223,7 +1299,6 @@
  	}
- 	
+ 
  	if (con->state == CON_STATE_WRITE &&
 -	    !chunkqueue_is_empty(con->write_queue) &&
  	    con->is_writable) {
- 		
+ 
  		if (-1 == connection_handle_write(srv, con)) {
-@@ -1573,15 +1646,15 @@
+@@ -1640,15 +1715,15 @@
  			}
- 			
+ 
  			/* only try to write if we have something in the queue */
 -			if (!chunkqueue_is_empty(con->write_queue)) {
  #if 0
@@ -406,11 +392,11 @@
  				if (-1 == connection_handle_write(srv, con)) {
  					log_error_write(srv, __FILE__, __LINE__, "ds",
  							con->fd,
-@@ -1691,9 +1764,9 @@
+@@ -1758,9 +1833,9 @@
  		 * - if we have data to write
- 		 * - if the socket is not writable yet 
+ 		 * - if the socket is not writable yet
  		 */
--		if (!chunkqueue_is_empty(con->write_queue) && 
+-		if (!chunkqueue_is_empty(con->write_queue) &&
 -		    (con->is_writable == 0) &&
 -		    (con->traffic_limit_reached == 0)) {
 +		if ((con->is_writable == 0) &&
@@ -419,86 +405,173 @@
  			fdevent_event_add(srv->ev, &(con->fde_ndx), con->fd, FDEVENT_OUT);
  		} else {
  			fdevent_event_del(srv->ev, &(con->fde_ndx), con->fd);
-diff -Naur lighttpd-1.4.10.orig/src/http_chunk.c lighttpd-1.4.10/src/http_chunk.c
---- lighttpd-1.4.10.orig/src/http_chunk.c	2005-08-10 15:26:50.000000000 -0700
-+++ lighttpd-1.4.10/src/http_chunk.c	2006-02-16 22:25:16.508346367 -0800
+diff -Naur lighttpd-1.4.19/src/http_chunk.c lighttpd-1.4.19.mod_deflate.jz/src/http_chunk.c
+--- lighttpd-1.4.19/src/http_chunk.c
++++ lighttpd-1.4.19.mod_deflate.jz/src/http_chunk.c
 @@ -58,16 +58,9 @@
- 	
+ 
  	cq = con->write_queue;
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
 -		http_chunk_append_len(srv, con, len);
 -	}
--	
-+
+ 
  	chunkqueue_append_file(cq, fn, offset, len);
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED && len > 0) {
 -		chunkqueue_append_mem(cq, "\r\n", 2 + 1);
 -	}
--	
+-
  	return 0;
  }
  
 @@ -78,16 +71,9 @@
- 	
+ 
  	cq = con->write_queue;
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
 -		http_chunk_append_len(srv, con, mem->used - 1);
 -	}
--	
-+
+ 
  	chunkqueue_append_buffer(cq, mem);
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED && mem->used > 0) {
 -		chunkqueue_append_mem(cq, "\r\n", 2 + 1);
 -	}
--	
+-
  	return 0;
  }
  
-@@ -99,25 +85,11 @@
+@@ -99,24 +85,11 @@
  	cq = con->write_queue;
- 	
+ 
  	if (len == 0) {
 -		if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
--			http_chunk_append_len(srv, con, 0);
--			chunkqueue_append_mem(cq, "\r\n", 2 + 1);
+-			chunkqueue_append_mem(cq, "0\r\n\r\n", 5 + 1);
 -		} else {
 -			chunkqueue_append_mem(cq, "", 1);
 -		}
  		return 0;
  	}
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
 -		http_chunk_append_len(srv, con, len - 1);
 -	}
--	
+-
  	chunkqueue_append_mem(cq, mem, len);
- 	
+ 
 -	if (con->response.transfer_encoding & HTTP_TRANSFER_ENCODING_CHUNKED) {
 -		chunkqueue_append_mem(cq, "\r\n", 2 + 1);
 -	}
--	
+-
  	return 0;
  }
  
-diff -Naur lighttpd-1.4.10.orig/src/joblist.c lighttpd-1.4.10/src/joblist.c
---- lighttpd-1.4.10.orig/src/joblist.c	2005-08-10 15:26:41.000000000 -0700
-+++ lighttpd-1.4.10/src/joblist.c	2006-02-16 22:25:16.508346367 -0800
+diff -Naur lighttpd-1.4.19/src/joblist.c lighttpd-1.4.19.mod_deflate.jz/src/joblist.c
+--- lighttpd-1.4.19/src/joblist.c
++++ lighttpd-1.4.19.mod_deflate.jz/src/joblist.c
 @@ -7,6 +7,7 @@
  
  int joblist_append(server *srv, connection *con) {
  	if (con->in_joblist) return 0;
 +	con->in_joblist = 1;
- 	
+ 
  	if (srv->joblist->size == 0) {
  		srv->joblist->size  = 16;
-diff -Naur lighttpd-1.4.10.orig/src/mod_deflate.c lighttpd-1.4.10/src/mod_deflate.c
---- lighttpd-1.4.10.orig/src/mod_deflate.c	1969-12-31 16:00:00.000000000 -0800
-+++ lighttpd-1.4.10/src/mod_deflate.c	2006-02-17 23:26:45.885437687 -0800
-@@ -0,0 +1,1291 @@
+diff -Naur lighttpd-1.4.19/src/Makefile.am lighttpd-1.4.19.mod_deflate.jz/src/Makefile.am
+--- lighttpd-1.4.19/src/Makefile.am
++++ lighttpd-1.4.19.mod_deflate.jz/src/Makefile.am
+@@ -241,6 +241,11 @@
+ mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
+ mod_accesslog_la_LIBADD = $(common_libadd)
+ 
++lib_LTLIBRARIES += mod_deflate.la
++mod_deflate_la_SOURCES = mod_deflate.c 
++mod_deflate_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
++mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
++
+ 
+ hdr = server.h buffer.h network.h log.h keyvalue.h \
+       response.h request.h fastcgi.h chunk.h \
+diff -Naur lighttpd-1.4.19/src/Makefile.in lighttpd-1.4.19.mod_deflate.jz/src/Makefile.in
+--- lighttpd-1.4.19/src/Makefile.in
++++ lighttpd-1.4.19.mod_deflate.jz/src/Makefile.in
+@@ -158,8 +158,15 @@
+ am_mod_compress_la_OBJECTS = mod_compress.lo
+ mod_compress_la_OBJECTS = $(am_mod_compress_la_OBJECTS)
+ mod_compress_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+ 	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ 	$(mod_compress_la_LDFLAGS) $(LDFLAGS) -o $@
++mod_deflate_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \
++	$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2)
++am_mod_deflate_la_OBJECTS = mod_deflate.lo
++mod_deflate_la_OBJECTS = $(am_mod_deflate_la_OBJECTS)
++mod_deflate_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
++	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
++	$(mod_deflate_la_LDFLAGS) $(LDFLAGS) -o $@
+ mod_dirlisting_la_DEPENDENCIES = $(am__DEPENDENCIES_2) \
+ 	$(am__DEPENDENCIES_1)
+ am_mod_dirlisting_la_OBJECTS = mod_dirlisting.lo
+@@ -399,6 +404,7 @@
+ 	$(mod_accesslog_la_SOURCES) $(mod_alias_la_SOURCES) \
+ 	$(mod_auth_la_SOURCES) $(mod_cgi_la_SOURCES) \
+ 	$(mod_cml_la_SOURCES) $(mod_compress_la_SOURCES) \
++	$(mod_deflate_la_SOURCES) \
+ 	$(mod_dirlisting_la_SOURCES) $(mod_evasive_la_SOURCES) \
+ 	$(mod_evhost_la_SOURCES) $(mod_expire_la_SOURCES) \
+ 	$(mod_fastcgi_la_SOURCES) $(mod_flv_streaming_la_SOURCES) \
+@@ -614,7 +619,7 @@
+ 	mod_ssi.la mod_secdownload.la mod_expire.la mod_evhost.la \
+ 	mod_simple_vhost.la mod_fastcgi.la mod_extforward.la \
+ 	mod_access.la mod_compress.la mod_auth.la mod_rewrite.la \
+-	mod_redirect.la mod_status.la mod_accesslog.la
++	mod_redirect.la mod_status.la mod_accesslog.la mod_deflate.la
+ @NO_RDYNAMIC_TRUE at liblightcomp_la_SOURCES = $(common_src)
+ @NO_RDYNAMIC_TRUE at liblightcomp_la_CFLAGS = $(AM_CFLAGS)
+ @NO_RDYNAMIC_TRUE at liblightcomp_la_LDFLAGS = -avoid-version -no-undefined
+@@ -721,6 +726,9 @@
+ mod_accesslog_la_SOURCES = mod_accesslog.c
+ mod_accesslog_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
+ mod_accesslog_la_LIBADD = $(common_libadd)
++mod_deflate_la_SOURCES = mod_deflate.c 
++mod_deflate_la_LDFLAGS = -module -export-dynamic -no-undefined
++mod_deflate_la_LIBADD = $(Z_LIB) $(BZ_LIB) $(common_libadd)
+ hdr = server.h buffer.h network.h log.h keyvalue.h \
+       response.h request.h fastcgi.h chunk.h \
+       settings.h http_chunk.h http_auth_digest.h \
+@@ -832,6 +840,8 @@
+	$(mod_cml_la_LINK) -rpath $(libdir) $(mod_cml_la_OBJECTS) $(mod_cml_la_LIBADD) $(LIBS)
+ mod_compress.la: $(mod_compress_la_OBJECTS) $(mod_compress_la_DEPENDENCIES) 
+	$(mod_compress_la_LINK) -rpath $(libdir) $(mod_compress_la_OBJECTS) $(mod_compress_la_LIBADD) $(LIBS)
++mod_deflate.la: $(mod_deflate_la_OBJECTS) $(mod_deflate_la_DEPENDENCIES) 
++	$(mod_deflate_la_LINK) -rpath $(libdir) $(mod_deflate_la_LDFLAGS) $(mod_deflate_la_OBJECTS) $(mod_deflate_la_LIBADD) $(LIBS)
+ mod_dirlisting.la: $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_DEPENDENCIES) 
+	$(mod_dirlisting_la_LINK) -rpath $(libdir) $(mod_dirlisting_la_OBJECTS) $(mod_dirlisting_la_LIBADD) $(LIBS)
+ mod_evasive.la: $(mod_evasive_la_OBJECTS) $(mod_evasive_la_DEPENDENCIES) 
+@@ -1050,6 +1060,7 @@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_cml_la-mod_cml_funcs.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_cml_la-mod_cml_lua.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_compress.Plo at am__quote@
++ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_deflate.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_dirlisting.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_evasive.Plo at am__quote@
+ @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/mod_evhost.Plo at am__quote@
+diff -Naur lighttpd-1.4.19/src/mod_deflate.c lighttpd-1.4.19.mod_deflate.jz/src/mod_deflate.c
+--- lighttpd-1.4.19/src/mod_deflate.c
++++ lighttpd-1.4.19.mod_deflate.jz/src/mod_deflate.c
+@@ -0,0 +1,1420 @@
++/* bug fix on Robert Jakabosky from alphatrade.com's lighttp 1.4.10 mod_deflate path
++ *
++ * new module option:
++ * deflate.nocompress-url = "^/nocompressurl/" # pcre regex which don't compress
++ *
++ * Bug fix and new features:
++ * 1) fix loop bug when content-length is bigger than work-block-size*k
++ * 2) prevent compress on buggy http 1.0 client with Accept Encoding: gzip, deflate
++ * 3) fix bug with chunk transfer encoding (under mod_fastcgi+php environment)
++ * 
++ * deflate.sync-flush = "enable" is buggy on chunk encoding transfer. Use it carefully,
++ */
 +#include <sys/types.h>
 +#include <sys/stat.h>
 +
@@ -511,6 +584,10 @@
 +#include <time.h>
 +#include <assert.h>
 +
++#if defined(HAVE_PCRE_H)
++#include <pcre.h>
++#endif
++
 +#include "base.h"
 +#include "log.h"
 +#include "buffer.h"
@@ -522,6 +599,7 @@
 +
 +#include "crc32.h"
 +#include "etag.h"
++#include "inet_ntop_cache.h"
 +
 +#if defined HAVE_ZLIB_H && defined HAVE_LIBZ
 +# define USE_ZLIB
@@ -562,6 +640,10 @@
 +	short		compression_level;
 +	short		window_size;
 +	array		*mimetypes;
++	buffer 		*nocompress_url;
++#if defined(HAVE_PCRE_H)
++	pcre	*nocompress_regex;
++#endif
 +} plugin_config;
 +
 +typedef struct {
@@ -630,7 +712,10 @@
 +			if (!s) continue;
 +			
 +			array_free(s->mimetypes);
-+			
++			buffer_free(s->nocompress_url);
++#if defined(HAVE_PCRE_H)
++		       	if (s->nocompress_regex) pcre_free(s->nocompress_regex);
++#endif
 +			free(s);
 +		}
 +		free(p->config_storage);
@@ -659,6 +744,7 @@
 +		{ "deflate.debug",                 NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
 +		{ "deflate.bzip2",                 NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
 +		{ "deflate.sync-flush",            NULL, T_CONFIG_BOOLEAN, T_CONFIG_SCOPE_CONNECTION },
<<Diff was trimmed, longer than 597 lines>>

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/lighttpd-mod_deflate.patch?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list