version 1.1.1.1, 2013/10/14 10:32:47
|
version 1.1.1.2, 2014/06/15 20:20:06
|
Line 12
|
Line 12
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
|
|
#include <assert.h> |
#include <fcntl.h> |
#include <fcntl.h> |
#include <unistd.h> |
#include <unistd.h> |
#include <ctype.h> |
#include <ctype.h> |
Line 161 SETDEFAULTS_FUNC(mod_compress_setdefaults) {
|
Line 162 SETDEFAULTS_FUNC(mod_compress_setdefaults) {
|
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } |
{ NULL, NULL, T_CONFIG_UNSET, T_CONFIG_SCOPE_UNSET } |
}; |
}; |
|
|
p->config_storage = calloc(1, srv->config_context->used * sizeof(specific_config *)); | p->config_storage = calloc(1, srv->config_context->used * sizeof(plugin_config *)); |
|
|
for (i = 0; i < srv->config_context->used; i++) { |
for (i = 0; i < srv->config_context->used; i++) { |
plugin_config *s; |
plugin_config *s; |
Line 412 static int deflate_file_to_buffer_bzip2(server *srv, c
|
Line 413 static int deflate_file_to_buffer_bzip2(server *srv, c
|
|
|
static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, buffer *fn, stat_cache_entry *sce, int type) { |
static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, buffer *fn, stat_cache_entry *sce, int type) { |
int ifd, ofd; |
int ifd, ofd; |
int ret = -1; | int ret; |
void *start; |
void *start; |
const char *filename = fn->ptr; |
const char *filename = fn->ptr; |
ssize_t r; |
ssize_t r; |
Line 525 static int deflate_file_to_file(server *srv, connectio
|
Line 526 static int deflate_file_to_file(server *srv, connectio
|
} |
} |
#endif |
#endif |
|
|
|
ret = -1; |
switch(type) { |
switch(type) { |
#ifdef USE_ZLIB |
#ifdef USE_ZLIB |
case HTTP_ACCEPT_ENCODING_GZIP: |
case HTTP_ACCEPT_ENCODING_GZIP: |
Line 541 static int deflate_file_to_file(server *srv, connectio
|
Line 543 static int deflate_file_to_file(server *srv, connectio
|
ret = deflate_file_to_buffer_bzip2(srv, con, p, start, sce->st.st_size); |
ret = deflate_file_to_buffer_bzip2(srv, con, p, start, sce->st.st_size); |
break; |
break; |
#endif |
#endif |
default: |
|
ret = -1; |
|
break; |
|
} |
} |
|
|
if (ret == 0) { |
if (ret == 0) { |
Line 860 PHYSICALPATH_FUNC(mod_compress_physical) {
|
Line 859 PHYSICALPATH_FUNC(mod_compress_physical) {
|
} else if (matched_encodings & HTTP_ACCEPT_ENCODING_X_GZIP) { |
} else if (matched_encodings & HTTP_ACCEPT_ENCODING_X_GZIP) { |
compression_type = HTTP_ACCEPT_ENCODING_X_GZIP; |
compression_type = HTTP_ACCEPT_ENCODING_X_GZIP; |
compression_name = dflt_x_gzip; |
compression_name = dflt_x_gzip; |
} else if (matched_encodings & HTTP_ACCEPT_ENCODING_DEFLATE) { | } else { |
| force_assert(matched_encodings & HTTP_ACCEPT_ENCODING_DEFLATE); |
compression_type = HTTP_ACCEPT_ENCODING_DEFLATE; |
compression_type = HTTP_ACCEPT_ENCODING_DEFLATE; |
compression_name = dflt_deflate; |
compression_name = dflt_deflate; |
} |
} |