Browse Source

new flag to enforce gzip even if client did not request it

dynamic-accesslists
denis 13 years ago
parent
commit
7d36ea2732
  1. 1
      Makefile
  2. 106
      opentracker.xcodeproj/project.pbxproj
  3. 4
      ot_http.c

1
Makefile

@ -27,6 +27,7 @@ BINDIR?=$(PREFIX)/bin
#FEATURES+=-DWANT_SYNC_LIVE #FEATURES+=-DWANT_SYNC_LIVE
#FEATURES+=-DWANT_IP_FROM_QUERY_STRING #FEATURES+=-DWANT_IP_FROM_QUERY_STRING
#FEATURES+=-DWANT_COMPRESSION_GZIP #FEATURES+=-DWANT_COMPRESSION_GZIP
#FEATURES+=-DWANT_COMPRESSION_GZIP_ALWAYS
#FEATURES+=-DWANT_LOG_NETWORKS #FEATURES+=-DWANT_LOG_NETWORKS
#FEATURES+=-DWANT_RESTRICT_STATS #FEATURES+=-DWANT_RESTRICT_STATS
#FEATURES+=-DWANT_IP_FROM_PROXY #FEATURES+=-DWANT_IP_FROM_PROXY

106
opentracker.xcodeproj/project.pbxproj

@ -39,7 +39,6 @@
/* Begin PBXFileReference section */ /* Begin PBXFileReference section */
6520B7520D036AAF00A43B1F /* libowfat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libowfat.a; path = ../libowfat/libowfat.a; sourceTree = SOURCE_ROOT; }; 6520B7520D036AAF00A43B1F /* libowfat.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libowfat.a; path = ../libowfat/libowfat.a; sourceTree = SOURCE_ROOT; };
6520B8110D0E011000A43B1F /* liblibowfat.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = liblibowfat.a; sourceTree = BUILT_PRODUCTS_DIR; };
653A320A0CE7F475007F0D03 /* ot_accesslist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_accesslist.h; sourceTree = "<group>"; }; 653A320A0CE7F475007F0D03 /* ot_accesslist.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ot_accesslist.h; sourceTree = "<group>"; };
653A320B0CE7F475007F0D03 /* ot_accesslist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_accesslist.c; sourceTree = "<group>"; }; 653A320B0CE7F475007F0D03 /* ot_accesslist.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ot_accesslist.c; sourceTree = "<group>"; };
653A56AC0CE201FF000CF140 /* opentracker */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = opentracker; sourceTree = BUILT_PRODUCTS_DIR; }; 653A56AC0CE201FF000CF140 /* opentracker */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = opentracker; sourceTree = BUILT_PRODUCTS_DIR; };
@ -70,13 +69,6 @@
/* End PBXFileReference section */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
654A80A60CD83615009035DE /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
8DD76FAD0486AB0100D96B5E /* Frameworks */ = { 8DD76FAD0486AB0100D96B5E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -93,6 +85,7 @@
children = ( children = (
65542D810CE0786F00469330 /* Headers */, 65542D810CE0786F00469330 /* Headers */,
08FB7795FE84155DC02AAC07 /* Source */, 08FB7795FE84155DC02AAC07 /* Source */,
92762AC9104EDED700FDCB60 /* Libraries */,
C6A0FF2B0290797F04C91782 /* Documentation */, C6A0FF2B0290797F04C91782 /* Documentation */,
653A56AD0CE201FF000CF140 /* Products */, 653A56AD0CE201FF000CF140 /* Products */,
); );
@ -123,8 +116,6 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
653A56AC0CE201FF000CF140 /* opentracker */, 653A56AC0CE201FF000CF140 /* opentracker */,
6520B7520D036AAF00A43B1F /* libowfat.a */,
6520B8110D0E011000A43B1F /* liblibowfat.a */,
); );
name = Products; name = Products;
sourceTree = "<group>"; sourceTree = "<group>";
@ -148,6 +139,14 @@
name = Headers; name = Headers;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
92762AC9104EDED700FDCB60 /* Libraries */ = {
isa = PBXGroup;
children = (
6520B7520D036AAF00A43B1F /* libowfat.a */,
);
name = Libraries;
sourceTree = "<group>";
};
C6A0FF2B0290797F04C91782 /* Documentation */ = { C6A0FF2B0290797F04C91782 /* Documentation */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
@ -158,34 +157,7 @@
}; };
/* End PBXGroup section */ /* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
654A80A40CD83615009035DE /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXHeadersBuildPhase section */
/* Begin PBXNativeTarget section */ /* Begin PBXNativeTarget section */
654A80A70CD83615009035DE /* libowfat */ = {
isa = PBXNativeTarget;
buildConfigurationList = 654A80AB0CD83635009035DE /* Build configuration list for PBXNativeTarget "libowfat" */;
buildPhases = (
654A80A40CD83615009035DE /* Headers */,
654A80A50CD83615009035DE /* Sources */,
654A80A60CD83615009035DE /* Frameworks */,
);
buildRules = (
);
dependencies = (
);
name = libowfat;
productName = libowfat;
productReference = 6520B8110D0E011000A43B1F /* liblibowfat.a */;
productType = "com.apple.product-type.library.static";
};
8DD76FA90486AB0100D96B5E /* opentracker */ = { 8DD76FA90486AB0100D96B5E /* opentracker */ = {
isa = PBXNativeTarget; isa = PBXNativeTarget;
buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "opentracker" */; buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "opentracker" */;
@ -218,19 +190,11 @@
projectRoot = ""; projectRoot = "";
targets = ( targets = (
8DD76FA90486AB0100D96B5E /* opentracker */, 8DD76FA90486AB0100D96B5E /* opentracker */,
654A80A70CD83615009035DE /* libowfat */,
); );
}; };
/* End PBXProject section */ /* End PBXProject section */
/* Begin PBXSourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */
654A80A50CD83615009035DE /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
8DD76FAB0486AB0100D96B5E /* Sources */ = { 8DD76FAB0486AB0100D96B5E /* Sources */ = {
isa = PBXSourcesBuildPhase; isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
@ -290,7 +254,7 @@
1DEB928A08733DD80010E9CD /* Debug */ = { 1DEB928A08733DD80010E9CD /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(NATIVE_ARCH)"; ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
WANT_ACCESSLIST_WHITE, WANT_ACCESSLIST_WHITE,
WANT_IP_FROM_QUERY_STRING, WANT_IP_FROM_QUERY_STRING,
@ -301,16 +265,16 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../libowfat/; HEADER_SEARCH_PATHS = ../libowfat/;
LIBRARY_SEARCH_PATHS = ../libowfat/; LIBRARY_SEARCH_PATHS = ../libowfat/;
ONLY_ACTIVE_ARCH = YES; ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)";
PREBINDING = NO; PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk"; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
}; };
name = Debug; name = Debug;
}; };
1DEB928B08733DD80010E9CD /* Release */ = { 1DEB928B08733DD80010E9CD /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ARCHS = "$(NATIVE_ARCH)"; ARCHS = "$(ONLY_ACTIVE_ARCH_PRE_XCODE_3_1)";
DEAD_CODE_STRIPPING = NO; DEAD_CODE_STRIPPING = NO;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
WANT_ACCESSLIST_WHITE, WANT_ACCESSLIST_WHITE,
@ -322,40 +286,9 @@
GCC_WARN_UNUSED_VARIABLE = YES; GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = ../libowfat/; HEADER_SEARCH_PATHS = ../libowfat/;
LIBRARY_SEARCH_PATHS = ../libowfat/; LIBRARY_SEARCH_PATHS = ../libowfat/;
MACH_O_TYPE = mh_execute; ONLY_ACTIVE_ARCH_PRE_XCODE_3_1 = "$(NATIVE_ARCH_ACTUAL)";
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = "-lowfat";
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
ZERO_LINK = NO;
};
name = Release;
};
654A80A90CD83617009035DE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
INSTALL_PATH = /usr/local/lib;
PREBINDING = NO; PREBINDING = NO;
PRODUCT_NAME = libowfat; SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.6.sdk";
ZERO_LINK = YES;
};
name = Debug;
};
654A80AA0CD83617009035DE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
INSTALL_PATH = /usr/local/lib;
PREBINDING = NO;
PRODUCT_NAME = libowfat;
ZERO_LINK = NO; ZERO_LINK = NO;
}; };
name = Release; name = Release;
@ -381,15 +314,6 @@
defaultConfigurationIsVisible = 0; defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release; defaultConfigurationName = Release;
}; };
654A80AB0CD83635009035DE /* Build configuration list for PBXNativeTarget "libowfat" */ = {
isa = XCConfigurationList;
buildConfigurations = (
654A80A90CD83617009035DE /* Debug */,
654A80AA0CD83617009035DE /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */ /* End XCConfigurationList section */
}; };
rootObject = 08FB7793FE84155DC02AAC07 /* Project object */; rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;

4
ot_http.c

@ -219,10 +219,14 @@ static const ot_keywords keywords_format[] =
tai6464 t; tai6464 t;
#ifdef WANT_COMPRESSION_GZIP #ifdef WANT_COMPRESSION_GZIP
ws->request[ws->request_size] = 0; ws->request[ws->request_size] = 0;
#ifdef WANT_COMPRESSION_GZIP_ALWAYS
if( strstr( read_ptr - 1, "gzip" ) ) { if( strstr( read_ptr - 1, "gzip" ) ) {
#endif
cookie->flag |= STRUCT_HTTP_FLAG_GZIP; cookie->flag |= STRUCT_HTTP_FLAG_GZIP;
format |= TASK_FLAG_GZIP; format |= TASK_FLAG_GZIP;
#ifdef WANT_COMPRESSION_GZIP_ALWAYS
} }
#endif
#endif #endif
/* Pass this task to the worker thread */ /* Pass this task to the worker thread */
cookie->flag |= STRUCT_HTTP_FLAG_WAITINGFORTASK; cookie->flag |= STRUCT_HTTP_FLAG_WAITINGFORTASK;

Loading…
Cancel
Save