diff --git a/Frameworks/JNetLib/English.lproj/InfoPlist.strings b/Frameworks/JNetLib/English.lproj/InfoPlist.strings
deleted file mode 100644
index 5e45963c3..000000000
Binary files a/Frameworks/JNetLib/English.lproj/InfoPlist.strings and /dev/null differ
diff --git a/Frameworks/JNetLib/Info.plist b/Frameworks/JNetLib/Info.plist
deleted file mode 100644
index 0ec80c387..000000000
--- a/Frameworks/JNetLib/Info.plist
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
- CFBundleDevelopmentRegion
- English
- CFBundleExecutable
- ${EXECUTABLE_NAME}
- CFBundleName
- ${PRODUCT_NAME}
- CFBundleIconFile
-
- CFBundleIdentifier
- com.yourcompany.${PRODUCT_NAME:identifier}
- CFBundleInfoDictionaryVersion
- 6.0
- CFBundlePackageType
- FMWK
- CFBundleSignature
- ????
- CFBundleVersion
- 1.0
- NSPrincipalClass
-
-
-
diff --git a/Frameworks/JNetLib/JNetLib.xcodeproj/TemplateIcon.icns b/Frameworks/JNetLib/JNetLib.xcodeproj/TemplateIcon.icns
deleted file mode 100644
index 62cb7015e..000000000
Binary files a/Frameworks/JNetLib/JNetLib.xcodeproj/TemplateIcon.icns and /dev/null differ
diff --git a/Frameworks/JNetLib/JNetLib.xcodeproj/project.pbxproj b/Frameworks/JNetLib/JNetLib.xcodeproj/project.pbxproj
deleted file mode 100644
index 608006234..000000000
--- a/Frameworks/JNetLib/JNetLib.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,334 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 45;
- objects = {
-
-/* Begin PBXBuildFile section */
- 17F6C5F80F5F9D5B000D9DA9 /* asyncdns.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5D50F5F9D5B000D9DA9 /* asyncdns.cpp */; };
- 17F6C5F90F5F9D5B000D9DA9 /* asyncdns.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5D60F5F9D5B000D9DA9 /* asyncdns.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C5FB0F5F9D5B000D9DA9 /* connection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5D80F5F9D5B000D9DA9 /* connection.cpp */; };
- 17F6C5FC0F5F9D5B000D9DA9 /* connection.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5D90F5F9D5B000D9DA9 /* connection.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C5FD0F5F9D5B000D9DA9 /* httpget.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5DA0F5F9D5B000D9DA9 /* httpget.cpp */; };
- 17F6C5FE0F5F9D5B000D9DA9 /* httpget.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5DB0F5F9D5B000D9DA9 /* httpget.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C5FF0F5F9D5B000D9DA9 /* httppost.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5DC0F5F9D5B000D9DA9 /* httppost.cpp */; };
- 17F6C6000F5F9D5B000D9DA9 /* httppost.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5DD0F5F9D5B000D9DA9 /* httppost.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6010F5F9D5B000D9DA9 /* httpserv.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5DE0F5F9D5B000D9DA9 /* httpserv.cpp */; };
- 17F6C6020F5F9D5B000D9DA9 /* httpserv.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5DF0F5F9D5B000D9DA9 /* httpserv.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6050F5F9D5B000D9DA9 /* jnetlib.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5E20F5F9D5B000D9DA9 /* jnetlib.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6060F5F9D5B000D9DA9 /* listen.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5E30F5F9D5B000D9DA9 /* listen.cpp */; };
- 17F6C6070F5F9D5B000D9DA9 /* listen.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5E40F5F9D5B000D9DA9 /* listen.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6090F5F9D5B000D9DA9 /* netinc.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5E60F5F9D5B000D9DA9 /* netinc.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C60B0F5F9D5B000D9DA9 /* sslconnection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5E80F5F9D5B000D9DA9 /* sslconnection.cpp */; };
- 17F6C60C0F5F9D5B000D9DA9 /* sslconnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5E90F5F9D5B000D9DA9 /* sslconnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C60D0F5F9D5B000D9DA9 /* ssllisten.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5EA0F5F9D5B000D9DA9 /* ssllisten.cpp */; };
- 17F6C60E0F5F9D5B000D9DA9 /* ssllisten.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5EB0F5F9D5B000D9DA9 /* ssllisten.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6160F5F9D5B000D9DA9 /* udpconnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5F30F5F9D5B000D9DA9 /* udpconnection.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 17F6C6170F5F9D5B000D9DA9 /* util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 17F6C5F40F5F9D5B000D9DA9 /* util.cpp */; };
- 17F6C6180F5F9D5B000D9DA9 /* util.h in Headers */ = {isa = PBXBuildFile; fileRef = 17F6C5F50F5F9D5B000D9DA9 /* util.h */; settings = {ATTRIBUTES = (Public, ); }; };
- 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = ""; };
- 17F6C5D50F5F9D5B000D9DA9 /* asyncdns.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = asyncdns.cpp; path = jnetlib/asyncdns.cpp; sourceTree = ""; };
- 17F6C5D60F5F9D5B000D9DA9 /* asyncdns.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = asyncdns.h; path = jnetlib/asyncdns.h; sourceTree = ""; };
- 17F6C5D80F5F9D5B000D9DA9 /* connection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = connection.cpp; path = jnetlib/connection.cpp; sourceTree = ""; };
- 17F6C5D90F5F9D5B000D9DA9 /* connection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = connection.h; path = jnetlib/connection.h; sourceTree = ""; };
- 17F6C5DA0F5F9D5B000D9DA9 /* httpget.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = httpget.cpp; path = jnetlib/httpget.cpp; sourceTree = ""; };
- 17F6C5DB0F5F9D5B000D9DA9 /* httpget.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = httpget.h; path = jnetlib/httpget.h; sourceTree = ""; };
- 17F6C5DC0F5F9D5B000D9DA9 /* httppost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = httppost.cpp; path = jnetlib/httppost.cpp; sourceTree = ""; };
- 17F6C5DD0F5F9D5B000D9DA9 /* httppost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = httppost.h; path = jnetlib/httppost.h; sourceTree = ""; };
- 17F6C5DE0F5F9D5B000D9DA9 /* httpserv.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = httpserv.cpp; path = jnetlib/httpserv.cpp; sourceTree = ""; };
- 17F6C5DF0F5F9D5B000D9DA9 /* httpserv.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = httpserv.h; path = jnetlib/httpserv.h; sourceTree = ""; };
- 17F6C5E20F5F9D5B000D9DA9 /* jnetlib.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = jnetlib.h; path = jnetlib/jnetlib.h; sourceTree = ""; };
- 17F6C5E30F5F9D5B000D9DA9 /* listen.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = listen.cpp; path = jnetlib/listen.cpp; sourceTree = ""; };
- 17F6C5E40F5F9D5B000D9DA9 /* listen.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = listen.h; path = jnetlib/listen.h; sourceTree = ""; };
- 17F6C5E60F5F9D5B000D9DA9 /* netinc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = netinc.h; path = jnetlib/netinc.h; sourceTree = ""; };
- 17F6C5E80F5F9D5B000D9DA9 /* sslconnection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = sslconnection.cpp; path = jnetlib/sslconnection.cpp; sourceTree = ""; };
- 17F6C5E90F5F9D5B000D9DA9 /* sslconnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = sslconnection.h; path = jnetlib/sslconnection.h; sourceTree = ""; };
- 17F6C5EA0F5F9D5B000D9DA9 /* ssllisten.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ssllisten.cpp; path = jnetlib/ssllisten.cpp; sourceTree = ""; };
- 17F6C5EB0F5F9D5B000D9DA9 /* ssllisten.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ssllisten.h; path = jnetlib/ssllisten.h; sourceTree = ""; };
- 17F6C5F30F5F9D5B000D9DA9 /* udpconnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = udpconnection.h; path = jnetlib/udpconnection.h; sourceTree = ""; };
- 17F6C5F40F5F9D5B000D9DA9 /* util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = util.cpp; path = jnetlib/util.cpp; sourceTree = ""; };
- 17F6C5F50F5F9D5B000D9DA9 /* util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = util.h; path = jnetlib/util.h; sourceTree = ""; };
- 8DC2EF5A0486A6940098B216 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
- 8DC2EF5B0486A6940098B216 /* JNetLib.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = JNetLib.framework; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DC2EF560486A6940098B216 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 034768DFFF38A50411DB9C8B /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DC2EF5B0486A6940098B216 /* JNetLib.framework */,
- );
- name = Products;
- sourceTree = "";
- };
- 0867D691FE84028FC02AAC07 /* JNetLib */ = {
- isa = PBXGroup;
- children = (
- 08FB77AEFE84172EC02AAC07 /* Classes */,
- 32C88DFF0371C24200C91783 /* Other Sources */,
- 089C1665FE841158C02AAC07 /* Resources */,
- 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
- 034768DFFF38A50411DB9C8B /* Products */,
- );
- name = JNetLib;
- sourceTree = "";
- };
- 0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
- isa = PBXGroup;
- children = (
- );
- name = "External Frameworks and Libraries";
- sourceTree = "";
- };
- 089C1665FE841158C02AAC07 /* Resources */ = {
- isa = PBXGroup;
- children = (
- 8DC2EF5A0486A6940098B216 /* Info.plist */,
- 089C1666FE841158C02AAC07 /* InfoPlist.strings */,
- );
- name = Resources;
- sourceTree = "";
- };
- 08FB77AEFE84172EC02AAC07 /* Classes */ = {
- isa = PBXGroup;
- children = (
- 17F6C5D50F5F9D5B000D9DA9 /* asyncdns.cpp */,
- 17F6C5D60F5F9D5B000D9DA9 /* asyncdns.h */,
- 17F6C5D80F5F9D5B000D9DA9 /* connection.cpp */,
- 17F6C5D90F5F9D5B000D9DA9 /* connection.h */,
- 17F6C5DA0F5F9D5B000D9DA9 /* httpget.cpp */,
- 17F6C5DB0F5F9D5B000D9DA9 /* httpget.h */,
- 17F6C5DC0F5F9D5B000D9DA9 /* httppost.cpp */,
- 17F6C5DD0F5F9D5B000D9DA9 /* httppost.h */,
- 17F6C5DE0F5F9D5B000D9DA9 /* httpserv.cpp */,
- 17F6C5DF0F5F9D5B000D9DA9 /* httpserv.h */,
- 17F6C5E20F5F9D5B000D9DA9 /* jnetlib.h */,
- 17F6C5E30F5F9D5B000D9DA9 /* listen.cpp */,
- 17F6C5E40F5F9D5B000D9DA9 /* listen.h */,
- 17F6C5E60F5F9D5B000D9DA9 /* netinc.h */,
- 17F6C5E80F5F9D5B000D9DA9 /* sslconnection.cpp */,
- 17F6C5E90F5F9D5B000D9DA9 /* sslconnection.h */,
- 17F6C5EA0F5F9D5B000D9DA9 /* ssllisten.cpp */,
- 17F6C5EB0F5F9D5B000D9DA9 /* ssllisten.h */,
- 17F6C5F30F5F9D5B000D9DA9 /* udpconnection.h */,
- 17F6C5F40F5F9D5B000D9DA9 /* util.cpp */,
- 17F6C5F50F5F9D5B000D9DA9 /* util.h */,
- );
- name = Classes;
- sourceTree = "";
- };
- 32C88DFF0371C24200C91783 /* Other Sources */ = {
- isa = PBXGroup;
- children = (
- );
- name = "Other Sources";
- sourceTree = "";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- 8DC2EF500486A6940098B216 /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 17F6C5F90F5F9D5B000D9DA9 /* asyncdns.h in Headers */,
- 17F6C5FC0F5F9D5B000D9DA9 /* connection.h in Headers */,
- 17F6C5FE0F5F9D5B000D9DA9 /* httpget.h in Headers */,
- 17F6C6000F5F9D5B000D9DA9 /* httppost.h in Headers */,
- 17F6C6020F5F9D5B000D9DA9 /* httpserv.h in Headers */,
- 17F6C6050F5F9D5B000D9DA9 /* jnetlib.h in Headers */,
- 17F6C6070F5F9D5B000D9DA9 /* listen.h in Headers */,
- 17F6C6090F5F9D5B000D9DA9 /* netinc.h in Headers */,
- 17F6C60C0F5F9D5B000D9DA9 /* sslconnection.h in Headers */,
- 17F6C60E0F5F9D5B000D9DA9 /* ssllisten.h in Headers */,
- 17F6C6160F5F9D5B000D9DA9 /* udpconnection.h in Headers */,
- 17F6C6180F5F9D5B000D9DA9 /* util.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- 8DC2EF4F0486A6940098B216 /* JNetLib */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "JNetLib" */;
- buildPhases = (
- 8DC2EF500486A6940098B216 /* Headers */,
- 8DC2EF520486A6940098B216 /* Resources */,
- 8DC2EF540486A6940098B216 /* Sources */,
- 8DC2EF560486A6940098B216 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = JNetLib;
- productInstallPath = "$(HOME)/Library/Frameworks";
- productName = JNetLib;
- productReference = 8DC2EF5B0486A6940098B216 /* JNetLib.framework */;
- productType = "com.apple.product-type.framework";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 0867D690FE84028FC02AAC07 /* Project object */ = {
- isa = PBXProject;
- buildConfigurationList = 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "JNetLib" */;
- compatibilityVersion = "Xcode 3.1";
- hasScannedForEncodings = 1;
- mainGroup = 0867D691FE84028FC02AAC07 /* JNetLib */;
- productRefGroup = 034768DFFF38A50411DB9C8B /* Products */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- 8DC2EF4F0486A6940098B216 /* JNetLib */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXResourcesBuildPhase section */
- 8DC2EF520486A6940098B216 /* Resources */ = {
- isa = PBXResourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 8DC2EF530486A6940098B216 /* InfoPlist.strings in Resources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXResourcesBuildPhase section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DC2EF540486A6940098B216 /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 17F6C5F80F5F9D5B000D9DA9 /* asyncdns.cpp in Sources */,
- 17F6C5FB0F5F9D5B000D9DA9 /* connection.cpp in Sources */,
- 17F6C5FD0F5F9D5B000D9DA9 /* httpget.cpp in Sources */,
- 17F6C5FF0F5F9D5B000D9DA9 /* httppost.cpp in Sources */,
- 17F6C6010F5F9D5B000D9DA9 /* httpserv.cpp in Sources */,
- 17F6C6060F5F9D5B000D9DA9 /* listen.cpp in Sources */,
- 17F6C60B0F5F9D5B000D9DA9 /* sslconnection.cpp in Sources */,
- 17F6C60D0F5F9D5B000D9DA9 /* ssllisten.cpp in Sources */,
- 17F6C6170F5F9D5B000D9DA9 /* util.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXVariantGroup section */
- 089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
- isa = PBXVariantGroup;
- children = (
- 089C1667FE841158C02AAC07 /* English */,
- );
- name = InfoPlist.strings;
- sourceTree = "";
- };
-/* End PBXVariantGroup section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB91AE08733DA50010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_ENABLE_FIX_AND_CONTINUE = YES;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "@loader_path/../Frameworks";
- PRODUCT_NAME = JNetLib;
- SYMROOT = ../../build;
- WRAPPER_EXTENSION = framework;
- };
- name = Debug;
- };
- 1DEB91AF08733DA50010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- DYLIB_COMPATIBILITY_VERSION = 1;
- DYLIB_CURRENT_VERSION = 1;
- FRAMEWORK_VERSION = A;
- GCC_MODEL_TUNING = G5;
- INFOPLIST_FILE = Info.plist;
- INSTALL_PATH = "@loader_path/../Frameworks";
- PRODUCT_NAME = JNetLib;
- SYMROOT = ../../build;
- WRAPPER_EXTENSION = framework;
- };
- name = Release;
- };
- 1DEB91B208733DA50010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- ONLY_ACTIVE_ARCH = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.5;
- };
- name = Debug;
- };
- 1DEB91B308733DA50010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ARCHS = "$(ARCHS_STANDARD_32_BIT)";
- GCC_C_LANGUAGE_STANDARD = c99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- PREBINDING = NO;
- SDKROOT = macosx10.5;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB91AD08733DA50010E9CD /* Build configuration list for PBXNativeTarget "JNetLib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91AE08733DA50010E9CD /* Debug */,
- 1DEB91AF08733DA50010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB91B108733DA50010E9CD /* Build configuration list for PBXProject "JNetLib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91B208733DA50010E9CD /* Debug */,
- 1DEB91B308733DA50010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
-}
diff --git a/Frameworks/JNetLib/jnetlib/.DS_Store b/Frameworks/JNetLib/jnetlib/.DS_Store
deleted file mode 100644
index c7218c523..000000000
Binary files a/Frameworks/JNetLib/jnetlib/.DS_Store and /dev/null differ
diff --git a/Frameworks/JNetLib/jnetlib/CHANGES.txt b/Frameworks/JNetLib/jnetlib/CHANGES.txt
deleted file mode 100755
index fee39b7f0..000000000
--- a/Frameworks/JNetLib/jnetlib/CHANGES.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-+03/06/2006 Joshua Teitelbaum : Added file CHANGES.txt
-+03/06/2006 Joshua Teitelbaum : Added file README.txt
-+03/06/2006 Joshua Teitelbaum : Basic Integration with SSL
-+03/06/2006 Joshua Teitelbaum : Added new HTTP POST Test
-+03/06/2006 Joshua Teitelbaum : Added HTTPS Listen Test
-+03/06/2006 Joshua Teitelbaum : Added HTTPS Get Test
diff --git a/Frameworks/JNetLib/jnetlib/Makefile b/Frameworks/JNetLib/jnetlib/Makefile
deleted file mode 100755
index 58cab477e..000000000
--- a/Frameworks/JNetLib/jnetlib/Makefile
+++ /dev/null
@@ -1,20 +0,0 @@
-# freebsd3 makefile
-default: jnl.a
-
-LDFLAGS = -pthread
-CFLAGS = -s -O2 -Wall -DTHREAD_SAFE -D_THREAD_SAFE -D_REENTRANT
-CC = gcc
-CPP = g++
-CXX = g++
-
-OBJS = asyncdns.o connection.o httpget.o httpserv.o listen.o util.o sercon.o
-
-jnl.a: ${OBJS}
- -rm -f jnl.a
- ar rcs jnl.a ${OBJS}
-
-test: ${OBJS} test.o
- $(CC) ${CFLAGS} -o test test.o ${OBJS} ${LDFLAGS}
-
-clean:
- -rm -f ${OBJS} test jnl.a test.o
diff --git a/Frameworks/JNetLib/jnetlib/README.txt b/Frameworks/JNetLib/jnetlib/README.txt
deleted file mode 100755
index 305c3e88c..000000000
--- a/Frameworks/JNetLib/jnetlib/README.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-JNetLib Readme.txt
-/*
-**
-** Justin Frankel
-** www.cockos.com
-**
-** Joshua Teitelbaum
-** www.cryptomail.org
-*/
-
-Table of Contents:
-
-I) License
-II) Introduction
-III) Features
-IV) SSL Integration
-V) Postamble
-
-I) License
-
-This software is provided 'as-is', without any express or implied
-warranty. In no event will the authors be held liable for any damages
-arising from the use of this software.
-
-Permission is granted to anyone to use this software for any purpose,
-including commercial applications, and to alter it and redistribute it
-freely, subject to the following restrictions:
-
-1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
-2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
-3. This notice may not be removed or altered from any source distribution
-
-II) Introduction
-
-Welcome to the JNetLib library, a C++ asynchronous network abstraction layer.
-
-III) Features
-
-* Works under Linux, FreeBSD, Win32, and other operating systems.
-* TCP connections support
-* Listening sockets support
-* Asynchronous DNS support
-* HTTP serving and getting support (including basic authentication, GET/POST and HTTP/1.1 support)
-* Basic HTTPS serving, getting support (including basic authentication, and HTTP/1.1 support)
-* Completely asynchronous love for single threaded apps.
-* Coming soon: support for UDP, as well as serial i/o.
-
-IV) SSL Integration
-
-JNetLib now employs the OpenSSL encryption library from www.openssl.org.
-However, it is not compiled in as the default.
-If you would like to have SSL support compiled in you have to:
-1) uncomment the #define _JNETLIB_SSL_ 1 in netinc.h
-2) Obtain the openssl requisite libraries libeay32.lib and ssleay32.lib
-2a) You can obtain these libraries either by building them yourself via aquring the source yourself or...
-2b) Download the SSL quickpack for windows, and ensure that you have the SSL quickpack in your build environment
-You will need the proper include and library paths.
-If you downloaded the quickpack to C:\, then the appropriate build environment include directory would be "c:\openssl\include", and so forth.
-
-Disclaimer:
-SSL functionality is new, and not entirely feature complete.
-The current certification authentication tactic is to allow all certificates through, without checking any CA signatures.
-
-
-V) Postamble
-Questions/Comments
-joshuat@cryptomail.org
-
-
-
-
-
diff --git a/Frameworks/JNetLib/jnetlib/asyncdns.cpp b/Frameworks/JNetLib/jnetlib/asyncdns.cpp
deleted file mode 100755
index f0bcb38be..000000000
--- a/Frameworks/JNetLib/jnetlib/asyncdns.cpp
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: asyncdns.cpp - JNL portable asynchronous DNS implementation
-** License: see jnetlib.h
-*/
-
-#include "netinc.h"
-#include "util.h"
-#include "asyncdns.h"
-
-JNL_AsyncDNS::JNL_AsyncDNS(int max_cache_entries)
-{
- m_thread_kill=1;
- m_thread=0;
- m_cache_size=max_cache_entries;
- m_cache=(cache_entry *)::malloc(sizeof(cache_entry)*m_cache_size);
- memset(m_cache,0,sizeof(cache_entry)*m_cache_size);
-}
-
-JNL_AsyncDNS::~JNL_AsyncDNS()
-{
-#ifndef NO_DNS_SUPPORT
- m_thread_kill=1;
-
-#ifdef _WIN32
- if (m_thread)
- {
- WaitForSingleObject(m_thread,INFINITE);
- CloseHandle(m_thread);
- }
-#else
- if (m_thread)
- {
- void *p;
- pthread_join(m_thread,&p);
- }
-#endif//!_WIN32
-#endif//NO_DNS_SUPPORT
- free(m_cache);
-}
-
-#ifdef _WIN32
-unsigned long WINAPI JNL_AsyncDNS::_threadfunc(LPVOID _d)
-#else
-unsigned int JNL_AsyncDNS::_threadfunc(void *_d)
-#endif
-{
-#ifndef NO_DNS_SUPPORT
- int nowinsock=JNL::open_socketlib();
- JNL_AsyncDNS *_this=(JNL_AsyncDNS*)_d;
- int x;
- for (x = 0; x < _this->m_cache_size && !_this->m_thread_kill; x ++)
- {
- if (_this->m_cache[x].last_used && !_this->m_cache[x].resolved)
- {
- if (!nowinsock)
- {
- if (_this->m_cache[x].mode==0)
- {
- struct hostent *hostentry;
- hostentry=::gethostbyname(_this->m_cache[x].hostname);
- if (hostentry)
- {
- _this->m_cache[x].addr=*((int*)hostentry->h_addr);
- }
- else
- _this->m_cache[x].addr=INADDR_NONE;
- }
- else if (_this->m_cache[x].mode==1)
- {
- struct hostent *ent;
- ent=::gethostbyaddr((const char *)&_this->m_cache[x].addr,4,AF_INET);
- if (ent)
- {
- strncpy(_this->m_cache[x].hostname,ent->h_name,255);
- _this->m_cache[x].hostname[255]=0;
- }
- else
- {
- _this->m_cache[x].hostname[0]=0;
- }
- }
- _this->m_cache[x].resolved=1;
- }
- else
- {
- if (_this->m_cache[x].mode==0)
- {
- _this->m_cache[x].addr=INADDR_NONE;
- _this->m_cache[x].resolved=1;
- }
- else if (_this->m_cache[x].mode==1)
- {
- _this->m_cache[x].hostname[0]=0;
- _this->m_cache[x].resolved=1;
- }
- }
- }
- }
- if (!nowinsock) JNL::close_socketlib();
- _this->m_thread_kill=1;
-#endif // NO_DNS_SUPPORT
-
- return 0;
-}
-
-int JNL_AsyncDNS::resolve(char *hostname, unsigned long *addr)
-{
- // return 0 on success, 1 on wait, -1 on unresolvable
- int x;
- unsigned long ip=inet_addr(hostname);
- if (ip != INADDR_NONE)
- {
- *addr=ip;
- return 0;
- }
-#ifndef NO_DNS_SUPPORT
-
- for (x = 0; x < m_cache_size; x ++)
- {
- if (!strcasecmp(m_cache[x].hostname,hostname) && m_cache[x].mode==0)
- {
- m_cache[x].last_used=time(NULL);
- if (m_cache[x].resolved)
- {
- if (m_cache[x].addr == INADDR_NONE)
- {
- return -1;
- }
- struct in_addr in;
- in.s_addr=m_cache[x].addr;
- *addr=m_cache[x].addr;
- return 0;
- }
- makesurethreadisrunning();
- return 1;
- }
- }
- // add to resolve list
- int oi=-1;
- for (x = 0; x < m_cache_size; x ++)
- {
- if (!m_cache[x].last_used)
- {
- oi=x;
- break;
- }
- if ((oi==-1 || m_cache[x].last_used < m_cache[oi].last_used) && m_cache[x].resolved)
- {
- oi=x;
- }
- }
- if (oi == -1)
- {
- return -1;
- }
- strcpy(m_cache[oi].hostname,hostname);
- m_cache[oi].mode=0;
- m_cache[oi].addr=INADDR_NONE;
- m_cache[oi].resolved=0;
- m_cache[oi].last_used=time(NULL);
-
- makesurethreadisrunning();
- return 1;
-#else
- return -1;
-#endif
-}
-
-int JNL_AsyncDNS::reverse(unsigned long addr, char *hostname)
-{
- // return 0 on success, 1 on wait, -1 on unresolvable
- int x;
- if (addr == INADDR_NONE)
- {
- return -1;
- }
-#ifndef NO_DNS_SUPPORT
- for (x = 0; x < m_cache_size; x ++)
- {
- if (m_cache[x].addr==addr && m_cache[x].mode==1)
- {
- m_cache[x].last_used=time(NULL);
- if (m_cache[x].resolved)
- {
- if (!m_cache[x].hostname[0])
- {
- return -1;
- }
- strncpy(hostname,m_cache[x].hostname,255);
- hostname[255]=0;
- return 0;
- }
- makesurethreadisrunning();
- return 1;
- }
- }
- // add to resolve list
- int oi=-1;
- for (x = 0; x < m_cache_size; x ++)
- {
- if (!m_cache[x].last_used)
- {
- oi=x;
- break;
- }
- if ((oi==-1 || m_cache[x].last_used < m_cache[oi].last_used) && m_cache[x].resolved)
- {
- oi=x;
- }
- }
- if (oi == -1)
- {
- return -1;
- }
- m_cache[oi].addr=addr;
- m_cache[oi].hostname[0]=0;
- m_cache[oi].resolved=0;
- m_cache[oi].mode=1;
- m_cache[oi].last_used=time(NULL);
-
- makesurethreadisrunning();
- return 1;
-#else
- return -1;
-#endif
-}
-
-
-void JNL_AsyncDNS::makesurethreadisrunning(void)
-{
-#ifndef NO_DNS_SUPPORT
- if (m_thread_kill)
- {
- #ifdef _WIN32
- if (m_thread)
- {
- WaitForSingleObject(m_thread,INFINITE);
- CloseHandle(m_thread);
- }
- DWORD id;
- m_thread_kill=0;
- m_thread=CreateThread(NULL,0,_threadfunc,(LPVOID)this,0,&id);
- if (!m_thread)
- {
- #else
- if (m_thread)
- {
- void *p;
- pthread_join(m_thread,&p);
- }
- m_thread_kill=0;
- if (pthread_create(&m_thread,NULL,(void *(*) (void *))_threadfunc,(void*)this) != 0)
- {
- #endif
- m_thread_kill=1;
- }
- }
-#endif//NO_DNS_SUPPORT
-}
diff --git a/Frameworks/JNetLib/jnetlib/asyncdns.h b/Frameworks/JNetLib/jnetlib/asyncdns.h
deleted file mode 100755
index 527088896..000000000
--- a/Frameworks/JNetLib/jnetlib/asyncdns.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: asyncdns.h - JNL portable asynchronous DNS interface
-** License: see jnetlib.h
-**
-** Usage:
-** 1. Create JNL_AsyncDNS object, optionally with the number of cache entries.
-** 2. call resolve() to resolve a hostname into an address. The return value of
-** resolve is 0 on success (host successfully resolved), 1 on wait (meaning
-** try calling resolve() with the same hostname in a few hundred milliseconds
-** or so), or -1 on error (i.e. the host can't resolve).
-** 3. call reverse() to do reverse dns (ala resolve()).
-** 4. enjoy.
-*/
-
-#ifndef _ASYNCDNS_H_
-#define _ASYNCDNS_H_
-
-class JNL_AsyncDNS
-{
-public:
- JNL_AsyncDNS(int max_cache_entries=64);
- ~JNL_AsyncDNS();
-
- int resolve(char *hostname, unsigned long *addr); // return 0 on success, 1 on wait, -1 on unresolvable
- int reverse(unsigned long addr, char *hostname); // return 0 on success, 1 on wait, -1 on unresolvable. hostname must be at least 256 bytes.
-
-private:
- typedef struct
- {
- int last_used; // timestamp.
- char resolved;
- char mode; // 1=reverse
- char hostname[256];
- unsigned long addr;
- }
- cache_entry;
-
- cache_entry *m_cache;
- int m_cache_size;
- volatile int m_thread_kill;
-#ifdef _WIN32
- HANDLE m_thread;
- static unsigned long WINAPI _threadfunc(LPVOID _d);
-#else
- pthread_t m_thread;
- static unsigned int _threadfunc(void *_d);
-#endif
- void makesurethreadisrunning(void);
-
-};
-
-#endif //_ASYNCDNS_H_
diff --git a/Frameworks/JNetLib/jnetlib/connection.cpp b/Frameworks/JNetLib/jnetlib/connection.cpp
deleted file mode 100755
index 28f09977f..000000000
--- a/Frameworks/JNetLib/jnetlib/connection.cpp
+++ /dev/null
@@ -1,520 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: connection.cpp - JNL TCP connection implementation
-** License: see jnetlib.h
-*/
-
-#include "netinc.h"
-#include "util.h"
-#include "connection.h"
-
-
-JNL_Connection::JNL_Connection(JNL_AsyncDNS *dns, int sendbufsize, int recvbufsize)
-{
- m_errorstr="";
- if (dns == JNL_CONNECTION_AUTODNS)
- {
- m_dns=new JNL_AsyncDNS();
- m_dns_owned=1;
- }
- else
- {
- m_dns=dns;
- m_dns_owned=0;
- }
- m_recv_buffer_len=recvbufsize;
- m_send_buffer_len=sendbufsize;
- m_recv_buffer=(char*)malloc(m_recv_buffer_len);
- m_send_buffer=(char*)malloc(m_send_buffer_len);
- m_socket=-1;
- memset(m_recv_buffer,0,recvbufsize);
- memset(m_send_buffer,0,sendbufsize);
- m_remote_port=0;
- m_state=STATE_NOCONNECTION;
- m_recv_len=m_recv_pos=0;
- m_send_len=m_send_pos=0;
- m_host[0]=0;
- m_saddr = new struct sockaddr_in;
- memset(m_saddr,0,sizeof(m_saddr));
-}
-
-void JNL_Connection::connect(int s, struct sockaddr_in *loc)
-{
- close(1);
- m_socket=s;
- m_remote_port=0;
- m_dns=NULL;
- if (loc) *m_saddr=*loc;
- else memset(m_saddr,0,sizeof(m_saddr));
- if (m_socket != -1)
- {
- SET_SOCK_BLOCK(m_socket,0);
- m_state=STATE_CONNECTED;
- }
- else
- {
- m_errorstr="invalid socket passed to connect";
- m_state=STATE_ERROR;
- }
-}
-
-void JNL_Connection::connect(char *hostname, int port)
-{
- close(1);
- m_remote_port=(short)port;
- m_socket=::socket(AF_INET,SOCK_STREAM,0);
- if (m_socket==-1)
- {
- m_errorstr="creating socket";
- m_state=STATE_ERROR;
- }
- else
- {
- SET_SOCK_BLOCK(m_socket,0);
- strncpy(m_host,hostname,sizeof(m_host)-1);
- m_host[sizeof(m_host)-1]=0;
- memset(m_saddr,0,sizeof(m_saddr));
- if (!m_host[0])
- {
- m_errorstr="empty hostname";
- m_state=STATE_ERROR;
- }
- else
- {
- m_state=STATE_RESOLVING;
- m_saddr->sin_family=AF_INET;
- m_saddr->sin_port=htons((unsigned short)port);
- m_saddr->sin_addr.s_addr=inet_addr(hostname);
- }
- }
-}
-
-/*
-** Joshua Teitelbaum 1/27/2006
-** socket_shutdown
-** virtualization for ssl
-*/
-/* Virtual */
-void JNL_Connection::socket_shutdown()
-{
- if (m_socket >= 0)
- {
- ::shutdown(m_socket, SHUT_RDWR);
- ::closesocket(m_socket);
- m_socket=-1;
- }
-}
-/*
-** Joshua Teitelbaum 1/27/2006
-** socket_recv
-** virtualization for ssl
-*/
-/* Virtual */
-int JNL_Connection::socket_recv(char *buf, int len, int options)
-{
- return ::recv(m_socket,buf,len,options);
-}
-/*
-** Joshua Teitelbaum 1/27/2006
-** socket_send
-** virtualization for ssl
-*/
-/* Virtual */
-int JNL_Connection::socket_send(char *buf, int len, int options)
-{
- return ::send(m_socket,buf,len,options);
-}
-
-int JNL_Connection::socket_connect()
-{
- return ::connect(m_socket,(struct sockaddr *)m_saddr,16);
-}
-JNL_Connection::~JNL_Connection()
-{
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** virtualization for ssl, calling socket_shtudown()
- */
- socket_shutdown();
-
- free(m_recv_buffer);
- free(m_send_buffer);
- if (m_dns_owned)
- {
- delete m_dns;
- }
- delete m_saddr;
-}
-
-void JNL_Connection::run(int max_send_bytes, int max_recv_bytes, int *bytes_sent, int *bytes_rcvd)
-{
- int bytes_allowed_to_send=(max_send_bytes<0)?m_send_buffer_len:max_send_bytes;
- int bytes_allowed_to_recv=(max_recv_bytes<0)?m_recv_buffer_len:max_recv_bytes;
-
- if (bytes_sent) *bytes_sent=0;
- if (bytes_rcvd) *bytes_rcvd=0;
-
- switch (m_state)
- {
- case STATE_RESOLVING:
- if (m_saddr->sin_addr.s_addr == INADDR_NONE)
- {
- int a=m_dns?m_dns->resolve(m_host,(unsigned long int *)&m_saddr->sin_addr.s_addr):-1;
- if (!a) { m_state=STATE_CONNECTING; }
- else if (a == 1)
- {
- m_state=STATE_RESOLVING;
- break;
- }
- else
- {
- m_errorstr="resolving hostname";
- m_state=STATE_ERROR;
- return;
- }
- }
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** virtualization for ssl
- */
- if(!socket_connect())
- {
- m_state=STATE_CONNECTED;
- on_socket_connected();
- }
- else if (ERRNO!=EINPROGRESS)
- {
- m_errorstr="connecting to host";
- m_state=STATE_ERROR;
- }
- else { m_state=STATE_CONNECTING; }
- break;
- case STATE_CONNECTING:
- {
- fd_set f[3];
- FD_ZERO(&f[0]);
- FD_ZERO(&f[1]);
- FD_ZERO(&f[2]);
- FD_SET(m_socket,&f[0]);
- FD_SET(m_socket,&f[1]);
- FD_SET(m_socket,&f[2]);
- struct timeval tv;
- memset(&tv,0,sizeof(tv));
- if (select(m_socket+1,&f[0],&f[1],&f[2],&tv)==-1)
- {
- m_errorstr="connecting to host (calling select())";
- m_state=STATE_ERROR;
- }
- else if (FD_ISSET(m_socket,&f[1]))
- {
- m_state=STATE_CONNECTED;
- on_socket_connected();
- }
- else if (FD_ISSET(m_socket,&f[2]))
- {
- m_errorstr="connecting to host";
- m_state=STATE_ERROR;
- }
- }
- break;
- case STATE_CONNECTED:
- case STATE_CLOSING:
- if (m_send_len>0 && bytes_allowed_to_send>0)
- {
- int len=m_send_buffer_len-m_send_pos;
- if (len > m_send_len) len=m_send_len;
- if (len > bytes_allowed_to_send) len=bytes_allowed_to_send;
- if (len > 0)
- {
- int res=socket_send(m_send_buffer+m_send_pos,len,0);
- if (res==-1 && ERRNO != EWOULDBLOCK)
- {
-// m_state=STATE_CLOSED;
-// return;
- }
- if (res>0)
- {
- bytes_allowed_to_send-=res;
- if (bytes_sent) *bytes_sent+=res;
- m_send_pos+=res;
- m_send_len-=res;
- }
- }
- if (m_send_pos>=m_send_buffer_len)
- {
- m_send_pos=0;
- if (m_send_len>0)
- {
- len=m_send_buffer_len-m_send_pos;
- if (len > m_send_len) len=m_send_len;
- if (len > bytes_allowed_to_send) len=bytes_allowed_to_send;
- int res=socket_send(m_send_buffer+m_send_pos,len,0);
- if (res==-1 && ERRNO != EWOULDBLOCK)
- {
-// m_state=STATE_CLOSED;
- }
- if (res>0)
- {
- bytes_allowed_to_send-=res;
- if (bytes_sent) *bytes_sent+=res;
- m_send_pos+=res;
- m_send_len-=res;
- }
- }
- }
- }
- if (m_recv_len m_recv_buffer_len-m_recv_len) len=m_recv_buffer_len-m_recv_len;
- if (len > bytes_allowed_to_recv) len=bytes_allowed_to_recv;
- if (len>0)
- {
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** virtualization for SSL
- */
- int res = socket_recv(m_recv_buffer+m_recv_pos,len,0);
-
- if (res == 0 || (res < 0 && ERRNO != EWOULDBLOCK))
- {
- m_state=STATE_CLOSED;
- break;
- }
- if (res > 0)
- {
- bytes_allowed_to_recv-=res;
- if (bytes_rcvd) *bytes_rcvd+=res;
- m_recv_pos+=res;
- m_recv_len+=res;
- }
- }
- if (m_recv_pos >= m_recv_buffer_len)
- {
- m_recv_pos=0;
- if (m_recv_len < m_recv_buffer_len)
- {
- len=m_recv_buffer_len-m_recv_len;
- if (len > bytes_allowed_to_recv) len=bytes_allowed_to_recv;
- if (len > 0)
- {
- int res=socket_recv(m_recv_buffer+m_recv_pos,len,0);
- if (res == 0 || (res < 0 && ERRNO != EWOULDBLOCK))
- {
- m_state=STATE_CLOSED;
- break;
- }
- if (res > 0)
- {
- bytes_allowed_to_recv-=res;
- if (bytes_rcvd) *bytes_rcvd+=res;
- m_recv_pos+=res;
- m_recv_len+=res;
- }
- }
- }
- }
- }
- if (m_state == STATE_CLOSING)
- {
- if (m_send_len < 1) m_state = STATE_CLOSED;
- }
- break;
- default: break;
- }
-}
-
-void JNL_Connection::on_socket_connected(void)
-{
- return;
-}
-void JNL_Connection::close(int quick)
-{
- if (quick || m_state == STATE_RESOLVING || m_state == STATE_CONNECTING)
- {
- m_state=STATE_CLOSED;
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** virualization for ssl
- */
- socket_shutdown();
-
- m_socket=-1;
- memset(m_recv_buffer,0,m_recv_buffer_len);
- memset(m_send_buffer,0,m_send_buffer_len);
- m_remote_port=0;
- m_recv_len=m_recv_pos=0;
- m_send_len=m_send_pos=0;
- m_host[0]=0;
- memset(m_saddr,0,sizeof(m_saddr));
- }
- else
- {
- if (m_state == STATE_CONNECTED) m_state=STATE_CLOSING;
- }
-}
-
-int JNL_Connection::send_bytes_in_queue(void)
-{
- return m_send_len;
-}
-
-int JNL_Connection::send_bytes_available(void)
-{
- return m_send_buffer_len-m_send_len;
-}
-
-int JNL_Connection::send(const void *_data, int length)
-{
- const char *data = static_cast(_data);
- if (length > send_bytes_available())
- {
- return -1;
- }
-
- int write_pos=m_send_pos+m_send_len;
- if (write_pos >= m_send_buffer_len)
- {
- write_pos-=m_send_buffer_len;
- }
-
- int len=m_send_buffer_len-write_pos;
- if (len > length)
- {
- len=length;
- }
-
- memcpy(m_send_buffer+write_pos,data,len);
- if (length > len)
- {
- memcpy(m_send_buffer,data+len,length-len);
- }
- m_send_len+=length;
- return 0;
-}
-
-int JNL_Connection::send_string(const char *line)
-{
- return send(line,strlen(line));
-}
-
-int JNL_Connection::recv_bytes_available(void)
-{
- return m_recv_len;
-}
-
-int JNL_Connection::peek_bytes(void *_data, int maxlength)
-{
- char *data = static_cast(_data);
- if (maxlength > m_recv_len)
- {
- maxlength=m_recv_len;
- }
- int read_pos=m_recv_pos-m_recv_len;
- if (read_pos < 0)
- {
- read_pos += m_recv_buffer_len;
- }
- int len=m_recv_buffer_len-read_pos;
- if (len > maxlength)
- {
- len=maxlength;
- }
- if (data != NULL) {
- memcpy(data,m_recv_buffer+read_pos,len);
- if (len < maxlength)
- {
- memcpy(data+len,m_recv_buffer,maxlength-len);
- }
- }
-
- return maxlength;
-}
-
-int JNL_Connection::recv_bytes(void *_data, int maxlength)
-{
- char *data = static_cast(_data);
-
- int ml=peek_bytes(data,maxlength);
- m_recv_len-=ml;
- return ml;
-}
-
-int JNL_Connection::getbfromrecv(int pos, int remove)
-{
- int read_pos=m_recv_pos-m_recv_len + pos;
- if (pos < 0 || pos > m_recv_len) return -1;
- if (read_pos < 0)
- {
- read_pos += m_recv_buffer_len;
- }
- if (read_pos >= m_recv_buffer_len)
- {
- read_pos-=m_recv_buffer_len;
- }
- if (remove) m_recv_len--;
- return m_recv_buffer[read_pos];
-}
-
-int JNL_Connection::recv_lines_available(void)
-{
- int l=recv_bytes_available();
- int lcount=0;
- int lastch=0;
- int pos;
- for (pos=0; pos < l; pos ++)
- {
- int t=getbfromrecv(pos,0);
- if (t == -1) return lcount;
- if ((t=='\r' || t=='\n') &&(
- (lastch != '\r' && lastch != '\n') || lastch==t
- )) lcount++;
- lastch=t;
- }
- return lcount;
-}
-
-int JNL_Connection::recv_line(char *line, int maxlength)
-{
- if (maxlength > m_recv_len) maxlength=m_recv_len;
- while (maxlength--)
- {
- int t=getbfromrecv(0,1);
- if (t == -1)
- {
- *line=0;
- return 0;
- }
- if (t == '\r' || t == '\n')
- {
- int r=getbfromrecv(0,0);
- if ((r == '\r' || r == '\n') && r != t) getbfromrecv(0,1);
- *line=0;
- return 0;
- }
- *line++=(char)t;
- }
- return 1;
-}
-
-unsigned long JNL_Connection::get_interface(void)
-{
- if (m_socket==-1) return 0;
- struct sockaddr_in sin;
- memset(&sin,0,sizeof(sin));
- socklen_t len=16;
- if (::getsockname(m_socket,(struct sockaddr *)&sin,&len)) return 0;
- return (unsigned long) sin.sin_addr.s_addr;
-}
-
-unsigned long JNL_Connection::get_remote()
-{
- return m_saddr->sin_addr.s_addr;
-}
-
-short JNL_Connection::get_remote_port()
-{
- return m_remote_port;
-}
diff --git a/Frameworks/JNetLib/jnetlib/connection.h b/Frameworks/JNetLib/jnetlib/connection.h
deleted file mode 100755
index 1443364a5..000000000
--- a/Frameworks/JNetLib/jnetlib/connection.h
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: connection.h - JNL TCP connection interface
-** License: see jnetlib.h
-**
-** Usage:
-** 1. Create a JNL_Connection object, optionally specifying a JNL_AsyncDNS
-** object to use (or NULL for none, or JNL_CONNECTION_AUTODNS for auto),
-** and the send and receive buffer sizes.
-** 2. Call connect() to have it connect to a host/port (the hostname will be
-** resolved if possible).
-** 3. call run() with the maximum send/recv amounts, and optionally parameters
-** so you can tell how much has been send/received. You want to do this a lot, while:
-** 4. check get_state() to check the state of the connection. The states are:
-** JNL_Connection::STATE_ERROR
-** - an error has occured on the connection. the connection has closed,
-** and you can no longer write to the socket (there still might be
-** data in the receive buffer - use recv_bytes_available()).
-** JNL_Connection::STATE_NOCONNECTION
-** - no connection has been made yet. call connect() already! :)
-** JNL_Connection::STATE_RESOLVING
-** - the connection is still waiting for a JNL_AsycnDNS to resolve the
-** host.
-** JNL_Connection::STATE_CONNECTING
-** - the asynchronous call to connect() is still running.
-** JNL_Connection::STATE_CONNECTED
-** - the connection has connected, all is well.
-** JNL_Connection::STATE_CLOSING
-** - the connection is closing. This happens after a call to close,
-** without the quick parameter set. This means that the connection
-** will close once the data in the send buffer is sent (data could
-** still be being received when it would be closed). After it is
-** closed, the state will transition to:
-** JNL_Connection::STATE_CLOSED
-** - the connection has closed, generally without error. There still
-** might be data in the receieve buffer, use recv_bytes_available().
-** 5. Use send() and send_string() to send data. You can use
-** send_bytes_in_queue() to see how much has yet to go out, or
-** send_bytes_available() to see how much you can write. If you use send()
-** or send_string() and not enough room is available, both functions will
-** return error ( < 0)
-** 6. Use recv() and recv_line() to get data. If you want to see how much data
-** there is, use recv_bytes_available() and recv_lines_available(). If you
-** call recv() and not enough data is available, recv() will return how much
-** data was actually read. See comments at the function defs.
-**
-** 7. To close, call close(1) for a quick close, or close() for a close that will
-** make the socket close after sending all the data sent.
-**
-** 8. delete ye' ol' object.
-*/
-
-#ifndef _CONNECTION_H_
-#define _CONNECTION_H_
-
-#include "asyncdns.h"
-
-#define JNL_CONNECTION_AUTODNS ((JNL_AsyncDNS*)-1)
-
-struct sockaddr_in;
-
-class JNL_Connection
-{
- public:
- typedef enum
- {
- STATE_ERROR,
- STATE_NOCONNECTION,
- STATE_RESOLVING,
- STATE_CONNECTING,
- STATE_CONNECTED,
- STATE_CLOSING,
- STATE_CLOSED
- } state;
-
- /*
- ** Joshua Teitelbaum, 1/27/2006 adding virtual
- */
- JNL_Connection(JNL_AsyncDNS *dns=JNL_CONNECTION_AUTODNS, int sendbufsize=8192, int recvbufsize=8192);
- virtual ~JNL_Connection();
-
-public:
- void connect(char *hostname, int port);
- virtual void connect(int sock, struct sockaddr_in *loc=NULL); // used by the listen object, usually not needed by users.
-
- /*
- ** Joshua Teitelbaum 2/2/2006
- ** Need to make this virtual to ensure SSL can init properly
- */
- virtual void run(int max_send_bytes=-1, int max_recv_bytes=-1, int *bytes_sent=NULL, int *bytes_rcvd=NULL);
- int get_state() { return m_state; }
- char *get_errstr() { return m_errorstr; }
-
- void close(int quick=0);
- void flush_send(void) { m_send_len=m_send_pos=0; }
-
- int send_bytes_in_queue(void);
- int send_bytes_available(void);
- int send(const void *data, int length); // returns -1 if not enough room
- inline int send_bytes(const void *data, int length) { return send(data, length); }
- int send_string(const char *line); // returns -1 if not enough room
-
-
- int recv_bytes_available(void);
- int recv_bytes(void *data, int maxlength); // returns actual bytes read
- unsigned int recv_int(void);
- int recv_lines_available(void);
- int recv_line(char *line, int maxlength); // returns 0 if the line was terminated with a \r or \n, 1 if not.
- // (i.e. if you specify maxlength=10, and the line is 12 bytes long
- // it will return 1. or if there is no \r or \n and that's all the data
- // the connection has.)
- int peek_bytes(void *data, int maxlength); // returns bytes peeked
-
- unsigned long get_interface(void); // this returns the interface the connection is on
- unsigned long get_remote(void); // remote host ip.
- short get_remote_port(void); // this returns the remote port of connection
-
- protected:
- int m_socket;
- short m_remote_port;
- char *m_recv_buffer;
- char *m_send_buffer;
- int m_recv_buffer_len;
- int m_send_buffer_len;
-
- int m_recv_pos;
- int m_recv_len;
- int m_send_pos;
- int m_send_len;
-
- struct sockaddr_in *m_saddr;
- char m_host[256];
-
- JNL_AsyncDNS *m_dns;
- int m_dns_owned;
-
- state m_state;
- char *m_errorstr;
-
- int getbfromrecv(int pos, int remove); // used by recv_line*
- /*
- ** Joshua Teitelbaum 1/27/2006 Adding new BSD socket analogues for SSL compatibility
- */
- virtual void socket_shutdown();
- virtual int socket_recv(char *buf, int len, int options);
- virtual int socket_send(char *buf, int len, int options);
- virtual int socket_connect();
- virtual void on_socket_connected();
-};
-
-#endif // _Connection_H_
diff --git a/Frameworks/JNetLib/jnetlib/httpget.cpp b/Frameworks/JNetLib/jnetlib/httpget.cpp
deleted file mode 100755
index 6b4a68eec..000000000
--- a/Frameworks/JNetLib/jnetlib/httpget.cpp
+++ /dev/null
@@ -1,490 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: httpget.cpp - JNL HTTP GET implementation
-** License: see jnetlib.h
-*/
-
-/*
-** Undefine this if you don't want SSL compiled in
-*/
-
-#include "netinc.h"
-#include "util.h"
-#include "httpget.h"
-#include "sslconnection.h"
-
-
-JNL_HTTPGet::JNL_HTTPGet(JNL_AsyncDNS *dns, int recvbufsize, char *proxy)
-{
- m_recvbufsize=recvbufsize;
- m_dns=dns;
- m_con=NULL;
- m_http_proxylpinfo=0;
- m_http_proxyhost=0;
- m_http_proxyport=0;
- if (proxy && *proxy)
- {
- char *p=(char*)malloc(strlen(proxy)+1);
- if (p)
- {
- char *r=NULL;
- strcpy(p,proxy);
- do_parse_url(p,&m_http_proxyhost,&m_http_proxyport,&r,&m_http_proxylpinfo);
- free(r);
- free(p);
- }
- }
- m_sendheaders=NULL;
- m_http_redir_url=0;
- reinit();
-}
-
-void JNL_HTTPGet::reinit()
-{
- m_errstr=0;
- m_recvheaders=NULL;
- m_recvheaders_size=0;
- m_http_state=0;
- m_http_port=0;
- m_http_url=0;
- m_reply=0;
- m_http_host=m_http_lpinfo=m_http_request=NULL;
-}
-
-void JNL_HTTPGet::deinit()
-{
- delete m_con; m_con = NULL;
- free(m_recvheaders);
-
- free(m_http_url);
- free(m_http_host);
- free(m_http_lpinfo);
- free(m_http_request);
- free(m_errstr);
- free(m_reply);
- reinit();
-}
-
-JNL_HTTPGet::~JNL_HTTPGet()
-{
- deinit();
- free(m_sendheaders);
- free(m_http_proxylpinfo);
- free(m_http_proxyhost);
- free(m_http_redir_url);
-
-}
-
-
-void JNL_HTTPGet::addheader(const char *header)
-{
- if (strstr(header,"\r") || strstr(header,"\n")) return;
- if (!m_sendheaders)
- {
- m_sendheaders=(char*)malloc(strlen(header)+3);
- if (m_sendheaders)
- {
- strcpy(m_sendheaders,header);
- strcat(m_sendheaders,"\r\n");
- }
- }
- else
- {
- char *t=(char*)malloc(strlen(header)+strlen(m_sendheaders)+1+2);
- if (t)
- {
- strcpy(t,m_sendheaders);
- strcat(t,header);
- strcat(t,"\r\n");
- free(m_sendheaders);
- m_sendheaders=t;
- }
- }
-}
-
-void JNL_HTTPGet::do_encode_mimestr(char *in, char *out)
-{
- char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- int shift = 0;
- int accum = 0;
-
- while (*in)
- {
- if (*in)
- {
- accum <<= 8;
- shift += 8;
- accum |= *in++;
- }
- while ( shift >= 6 )
- {
- shift -= 6;
- *out++ = alphabet[(accum >> shift) & 0x3F];
- }
- }
- if (shift == 4)
- {
- *out++ = alphabet[(accum & 0xF)<<2];
- *out++='=';
- }
- else if (shift == 2)
- {
- *out++ = alphabet[(accum & 0x3)<<4];
- *out++='=';
- *out++='=';
- }
-
- *out++=0;
-}
-
-
-void JNL_HTTPGet::connect(const char *url, int ver, char *requestmethod)
-{
- deinit();
- m_http_url=(char*)malloc(strlen(url)+1);
- strcpy(m_http_url,url);
- do_parse_url(m_http_url,&m_http_host,&m_http_port,&m_http_request, &m_http_lpinfo);
- strcpy(m_http_url,url);
- if (!m_http_host || !m_http_host[0] || !m_http_port)
- {
- m_http_state=-1;
- seterrstr("invalid URL");
- return;
- }
-
- int sendbufferlen=0;
-
- if (!m_http_proxyhost || !m_http_proxyhost[0])
- {
- sendbufferlen += strlen(requestmethod)+1 /* GET */ + strlen(m_http_request) + 9 /* HTTP/1.0 */ + 2;
- }
- else
- {
- sendbufferlen += strlen(requestmethod)+1 /* GET */ + strlen(m_http_url) + 9 /* HTTP/1.0 */ + 2;
- if (m_http_proxylpinfo&&m_http_proxylpinfo[0])
- {
- sendbufferlen+=58+strlen(m_http_proxylpinfo)*2; // being safe here
- }
- }
- sendbufferlen += 5 /* Host: */ + strlen(m_http_host) + 2;
-
- if (m_http_lpinfo&&m_http_lpinfo[0])
- {
- sendbufferlen+=46+strlen(m_http_lpinfo)*2; // being safe here
- }
-
- if (m_sendheaders) sendbufferlen+=strlen(m_sendheaders);
-
- char *str=(char*)malloc(sendbufferlen+1024);
- if (!str)
- {
- seterrstr("error allocating memory");
- m_http_state=-1;
- }
-
- if (!m_http_proxyhost || !m_http_proxyhost[0])
- {
- wsprintf(str,"%s %s HTTP/1.%d\r\n",requestmethod,m_http_request,ver%10);
- }
- else
- {
- wsprintf(str,"%s %s HTTP/1.%d\r\n",requestmethod, m_http_url,ver%10);
- }
-
- wsprintf(str+strlen(str),"Host:%s\r\n",m_http_host);
-
- if (m_http_lpinfo&&m_http_lpinfo[0])
- {
- strcat(str,"Authorization: Basic ");
- do_encode_mimestr(m_http_lpinfo,str+strlen(str));
- strcat(str,"\r\n");
- }
- if (m_http_proxylpinfo&&m_http_proxylpinfo[0])
- {
- strcat(str,"Proxy-Authorization: Basic ");
- do_encode_mimestr(m_http_proxylpinfo,str+strlen(str));
- strcat(str,"\r\n");
- }
-
- if (m_sendheaders) strcat(str,m_sendheaders);
- strcat(str,"\r\n");
-
- int a=m_recvbufsize;
- if (a < 4096) a=4096;
- //m_con=new JNL_Connection(m_dns,strlen(str)+4,a);
- /*
- ** Joshua Teitelbaum delta 1/15/2006
- */
-#ifdef _JNETLIB_SSL_
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** Check for secure
- */
- if(!strnicmp(m_http_url,"https:",strlen("https:")))
- {
- m_con=new JNL_SSL_Connection(NULL,m_dns,8192,a);
- }
- else
- {
- m_con=new JNL_Connection(m_dns,8192,a);
- }
-#else
- m_con=new JNL_Connection(m_dns,8192,a);
-#endif
-
- if (m_con)
- {
- if (!m_http_proxyhost || !m_http_proxyhost[0])
- {
- m_con->connect(m_http_host,m_http_port);
- }
- else
- {
- m_con->connect(m_http_proxyhost,m_http_proxyport);
- }
- m_con->send_string(str);
- }
- else
- {
- m_http_state=-1;
- seterrstr("could not create connection object");
- }
- free(str);
-
-}
-
-void JNL_HTTPGet::do_parse_url(char *url, char **host, int *port, char **req, char **lp)
-{
- char *p,*np;
- free(*host); *host=0;
- free(*req); *req=0;
- free(*lp); *lp=0;
-
- if (strstr(url,"://")) np=p=strstr(url,"://")+3;
- else np=p=url;
- while (*np != '/' && *np) np++;
- if (*np)
- {
- *req=(char*)malloc(strlen(np)+1);
- if (*req) strcpy(*req,np);
- *np++=0;
- }
- else
- {
- *req=(char*)malloc(2);
- if (*req) strcpy(*req,"/");
- }
-
- np=p;
- while (*np != '@' && *np) np++;
- if (*np)
- {
- *np++=0;
- *lp=(char*)malloc(strlen(p)+1);
- if (*lp) strcpy(*lp,p);
- p=np;
- }
- else
- {
- *lp=(char*)malloc(1);
- if (*lp) strcpy(*lp,"");
- }
- np=p;
- while (*np != ':' && *np) np++;
- if (*np)
- {
- *np++=0;
- *port=atoi(np);
- }
- else
- {
- /*
- ** Joshua Teitelbaum 1/27/2006
- ** HTTPS enhancements
- */
- if(!strnicmp(url,"https:",strlen("https:")))
- {
- *port = 443;
- }
- else
- *port=80;
- }
- *host=(char*)malloc(strlen(p)+1);
- if (*host) strcpy(*host,p);
-
-
-}
-
-
-char *JNL_HTTPGet::getallheaders()
-{ // double null terminated, null delimited list
- if (m_recvheaders) return m_recvheaders;
- else return "\0\0";
-}
-
-char *JNL_HTTPGet::getheader(char *headername)
-{
- char *ret=NULL;
- if (strlen(headername)<1||!m_recvheaders) return NULL;
- char *buf=(char*)malloc(strlen(headername)+2);
- strcpy(buf,headername);
- if (buf[strlen(buf)-1]!=':') strcat(buf,":");
- char *p=m_recvheaders;
- while (*p)
- {
- if (!strnicmp(buf,p,strlen(buf)))
- {
- ret=p+strlen(buf);
- while (*ret == ' ') ret++;
- break;
- }
- p+=strlen(p)+1;
- }
- free(buf);
- return ret;
-}
-
-int JNL_HTTPGet::run()
-{
- int cnt=0;
- if (m_http_state==-1||!m_con) return -1; // error
-
-
-run_again:
- m_con->run();
-
- if (m_con->get_state()==JNL_Connection::STATE_ERROR)
- {
- seterrstr(m_con->get_errstr());
- return -1;
- }
- if (m_con->get_state()==JNL_Connection::STATE_CLOSED) return 1;
-
- if (m_http_state==0) // connected, waiting for reply
- {
- if (m_con->recv_lines_available()>0)
- {
- char buf[4096];
- m_con->recv_line(buf,4095);
- buf[4095]=0;
- m_reply=(char*)malloc(strlen(buf)+1);
- strcpy(m_reply,buf);
-
- int code=getreplycode();
- if (code == 200 || code==206) m_http_state=2; // proceed to read headers normally
- else if (code == 301 || code==302)
- {
- m_http_state=1; // redirect city
- }
- else
- {
- seterrstr(buf);
- m_http_state=-1;
- return -1;
- }
- cnt=0;
- }
- else if (!cnt++) goto run_again;
- }
- if (m_http_state == 1) // redirect
- {
- while (m_con->recv_lines_available() > 0)
- {
- char buf[4096];
- m_con->recv_line(buf,4096);
- if (!buf[0])
- {
- m_http_state=-1;
- return -1;
- }
- if (!strnicmp(buf,"Location:",9))
- {
- char *p=buf+9; while (*p== ' ') p++;
- if (*p)
- {
- free(m_http_redir_url);
- m_http_redir_url = strdup(p);
- connect(p);
- return 0;
- }
- }
- }
- }
- if (m_http_state==2)
- {
- if (!cnt++ && m_con->recv_lines_available() < 1) goto run_again;
- while (m_con->recv_lines_available() > 0)
- {
- char buf[4096];
- m_con->recv_line(buf,4096);
- if (!buf[0]) { m_http_state=3; break; }
- if (!m_recvheaders)
- {
- m_recvheaders_size=strlen(buf)+1;
- m_recvheaders=(char*)malloc(m_recvheaders_size+1);
- if (m_recvheaders)
- {
- strcpy(m_recvheaders,buf);
- m_recvheaders[m_recvheaders_size]=0;
- }
- }
- else
- {
- int oldsize=m_recvheaders_size;
- m_recvheaders_size+=strlen(buf)+1;
- char *n=(char*)malloc(m_recvheaders_size+1);
- if (n)
- {
- memcpy(n,m_recvheaders,oldsize);
- strcpy(n+oldsize,buf);
- n[m_recvheaders_size]=0;
- free(m_recvheaders);
- m_recvheaders=n;
- }
- }
- }
- }
- if (m_http_state==3)
- {
- }
- return 0;
-}
-
-int JNL_HTTPGet::get_status() // returns 0 if connecting, 1 if reading headers,
- // 2 if reading content, -1 if error.
-{
- if (m_http_state < 0) return -1;
- if (m_http_state < 2) return 0;
- if (m_http_state == 2) return 1;
- if (m_http_state == 3) return 2;
- return -1;
-}
-
-int JNL_HTTPGet::getreplycode()// returns 0 if none yet, otherwise returns http reply code.
-{
- if (!m_reply) return 0;
- char *p=m_reply;
- while (*p && *p != ' ') p++; // skip over HTTP/x.x
- if (!*p) return 0;
- return atoi(++p);
-}
-
-int JNL_HTTPGet::bytes_available()
-{
- if (m_con && m_http_state==3) return m_con->recv_bytes_available();
- return 0;
-}
-char *JNL_HTTPGet::getredirurl() { return m_http_redir_url; }
-
-int JNL_HTTPGet::get_bytes(char *buf, int len)
-{
- if (m_con && m_http_state==3) return m_con->recv_bytes(buf,len);
- return 0;
-}
-int JNL_HTTPGet::peek_bytes(char *buf, int len)
-{
- if (m_con && m_http_state==3) return m_con->peek_bytes(buf,len);
- return 0;
-}
diff --git a/Frameworks/JNetLib/jnetlib/httpget.h b/Frameworks/JNetLib/jnetlib/httpget.h
deleted file mode 100755
index 2635a37e0..000000000
--- a/Frameworks/JNetLib/jnetlib/httpget.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) 2000-2001 Nullsoft, Inc.
-** Author: Justin Frankel
-** File: httpget.h - JNL interface for doing HTTP GETs.
-** License: see jnetlib.h
-**
-** Usage:
-** 1. Create a JNL_HTTPGet object, optionally specifying a JNL_AsyncDNS
-** object to use (or NULL for none, or JNL_CONNECTION_AUTODNS for auto),
-** and the receive buffer size, and a string specifying proxy (or NULL
-** for none). See note on proxy string below.
-** 2. call addheader() to add whatever headers you want. It is recommended to
-** add at least the following two:
-** addheader("User-Agent:MyApp (Mozilla)");
-*/// addheader("Accept:*/*");
-/* ( the comment weirdness is there so I Can do the star-slash :)
-** 3. Call connect() with the URL you wish to GET (see URL string note below)
-** 4. Call run() once in a while, checking to see if it returns -1
-** (if it does return -1, call geterrorstr() to see what the error is).
-** (if it returns 1, no big deal, the connection has closed).
-** 5. While you're at it, you can call bytes_available() to see if any data
-** from the http stream is available, or getheader() to see if any headers
-** are available, or getreply() to see the HTTP reply, or getallheaders()
-** to get a double null terminated, null delimited list of headers returned.
-** 6. If you want to read from the stream, call get_bytes (which returns how much
-** was actually read).
-** 7. content_length() is a helper function that uses getheader() to check the
-** content-length header.
-** 8. Delete ye' ol' object when done.
-**
-** Proxy String:
-** should be in the format of host:port, or user@host:port, or
-** user:password@host:port. if port is not specified, 80 is assumed.
-** URL String:
-** should be in the format of http://user:pass@host:port/requestwhatever
-** note that user, pass, port, and /requestwhatever are all optional :)
-** note that also, http:// is really not important. if you do poo://
-** or even leave out the http:// altogether, it will still work.
-*/
-
-#ifndef _HTTPGET_H_
-#define _HTTPGET_H_
-
-#include "connection.h"
-
-class JNL_HTTPGet
-{
- public:
- JNL_HTTPGet(JNL_AsyncDNS *dns=JNL_CONNECTION_AUTODNS, int recvbufsize=16384, char *proxy=NULL);
- ~JNL_HTTPGet();
-
- void addheader(const char *header);
-
- void connect(const char *url, int ver=0, char *requestmethod="GET");
-
- int run(); // returns: 0 if all is OK. -1 if error (call geterrorstr()). 1 if connection closed.
-
- int get_status(); // returns 0 if connecting, 1 if reading headers,
- // 2 if reading content, -1 if error.
-
- char *getallheaders(); // double null terminated, null delimited list
- char *getheader(char *headername);
- char *getreply() { return m_reply; }
- int getreplycode(); // returns 0 if none yet, otherwise returns http reply code.
-
- char *geterrorstr() { return m_errstr;}
-
- char *getredirurl();
-
- int bytes_available();
- int get_bytes(char *buf, int len);
- int peek_bytes(char *buf, int len);
-
- int content_length() { char *p=getheader("content-length"); if (p) return atoi(p); return 0; }
-
- JNL_Connection *get_con() { return m_con; }
-
- protected:
- void reinit();
- void deinit();
- void seterrstr(char *str) { if (m_errstr) free(m_errstr); m_errstr=(char*)malloc(strlen(str)+1); strcpy(m_errstr,str); }
-
- void do_parse_url(char *url, char **host, int *port, char **req, char **lp);
- void do_encode_mimestr(char *in, char *out);
-
- JNL_AsyncDNS *m_dns;
- JNL_Connection *m_con;
- int m_recvbufsize;
-
- int m_http_state;
-
- int m_http_port;
- char *m_http_url;
- char *m_http_redir_url;
- char *m_http_host;
- char *m_http_lpinfo;
- char *m_http_request;
-
- char *m_http_proxylpinfo;
- char *m_http_proxyhost;
- int m_http_proxyport;
-
- char *m_sendheaders;
- char *m_recvheaders;
- int m_recvheaders_size;
- char *m_reply;
-
- char *m_errstr;
-};
-
-#endif // _HTTPGET_H_
diff --git a/Frameworks/JNetLib/jnetlib/httppost.cpp b/Frameworks/JNetLib/jnetlib/httppost.cpp
deleted file mode 100755
index c1ec4eff6..000000000
--- a/Frameworks/JNetLib/jnetlib/httppost.cpp
+++ /dev/null
@@ -1,412 +0,0 @@
-/*
-** JNetLib
-** Copyright (C) Joshua Teitelbaum, sergent first class, 1014 army.
-** Author: Joshua Teitelbaum
-** File: httppost.cpp
-** License: see jnetlib.h
-*/
-
-#ifdef _WIN32
-#include
-#include
-#endif
-#include "netinc.h"
-#include "util.h"
-#include "httppost.h"
-
-#include
-#include
-
-static char *PREFIX = "--";
-static char *NEWLINE = "\r\n";
-
-/*
-** Joshua Teitelbaum 1/15/2006
-** 1014 Army, Sergent First Class
-** HTTP Post implementation employing HTTPGet as base class.
-*/
-/*
-** _endstack
-** when building the POST stack for a FORM, need a postamble
-*/
-void JNL_HTTPPost::_endstack()
-{
- std::string cd;
- cd = PREFIX;
- cd += m_boundary;
- cd += PREFIX;
- cd += NEWLINE;
-
- FILEStackObject fso;
- fso.m_otype = 2;
- fso.m_str = cd;
- m_filestack.push_back(fso);
-
-}
-/*
-** prepares one field and puts it on the stack
-*/
-void JNL_HTTPPost::_preparefield(std::string &name)
-{
- std::string cd;
-
- cd = PREFIX;
- cd += m_boundary;
- cd += NEWLINE;
- cd += "content-disposition: form-data; name=\"";
- cd += name;
- cd += "\"";
- cd += NEWLINE;
- cd += NEWLINE;
- cd += m_fields[name];
- cd += "\r\n";
-
- FILEStackObject fso;
-
- fso.m_otype = 3;
- fso.m_str = cd;
- m_filestack.push_back(fso);
-
-}
-/*
-** prepare all the fields, and push them on the stack
-*/
-void JNL_HTTPPost::_preparefieldstack()
-{
- std::map::iterator it;
-
- for(it = m_fields.begin(); it != m_fields.end(); it++)
- {
- std::string str = (*it).first;
- _preparefield(str);
- }
-}
-/*
-** prepare files and put them on the stack
-*/
-void JNL_HTTPPost::_preparefilestack()
-{
- std::map::iterator it;
-
- for(it = m_paths.begin(); it != m_paths.end(); it++)
- {
- /*
- --boundary\r\n
- Content-Disposition: form-data; name=""; filename=""\r\n
- Content-Type: \r\n
- \r\n
- \r\n
- */
-
- std::string cd ;
-
- cd = PREFIX;
- cd += m_boundary;
- cd += NEWLINE;
- cd += "content-disposition: form-data; name=\"";
- cd += (*it).first;
- cd += "\"; filename=\"";
- cd += m_filenames[(*it).first];
- cd += "\"";
- cd += NEWLINE;
- cd += "content-type: ";
- cd += m_content_type[(*it).first];
- cd += NEWLINE;
- cd += NEWLINE;
-
-
- FILEStackObject fso;
-
- fso.m_otype = 0;
- fso.m_str = cd;
- m_filestack.push_back(fso);
-
- fso.m_otype = 1;
- fso.m_str = (*it).first;
- m_filestack.push_back(fso);
-
- cd = NEWLINE;
-
- fso.m_otype = 2;
- fso.m_str = cd;
- m_filestack.push_back(fso);
- }
-
-}
-/*
-** payload function, run.
-** the tactic is this:
-** if we can't write, do normal run.
-**
-** while there is stuff on the POST stack
-** pop and item
-** write to the buffers as much as we can
-** if we can't write more, stop
-** end while
-** do normal run
-*/
-int JNL_HTTPPost::run()
-{
- bool stop = 0;
- std::map::iterator it;
- int ntowrite;
- int retval;
- do
- {
- if(m_con->send_bytes_available() <= 0)
- {
- /*
- ** rut roh, no buffa
- */
- break;
- }
-
- if(m_filestack.size() <= 0)
- {
- /*
- ** Nothing to do
- */
- break;
- }
- /*
- ** Get the current object off the stack
- */
- switch(m_filestack.front().m_otype)
- {
- case 0: /*preamble*/
- case 2: /*postamble*/
- case 3: /*plain jane field*/
- {
- ntowrite = m_filestack.front().m_str.length() - m_filestack.front().nwritten;
-
- if(m_con->send_bytes_available() < ntowrite)
- {
- ntowrite = m_con->send_bytes_available();
- }
- if(ntowrite>0)
- {
- retval = m_con->send(m_filestack.front().m_str.c_str() + m_filestack.front().nwritten,ntowrite);
-
- if(retval < 0)
- {
- break;
- }
-
- m_filestack.front().nwritten += ntowrite;
- m_nwritten += ntowrite;
-
- if( m_filestack.front().nwritten == m_filestack.front().m_str.length())
- {
- /*
- ** all done with this object
- */
- m_filestack.pop_front();
- }
- }
- else
- {
- retval = 0;
- stop = true;
- }
- }
- break;
- case 1: /*MEAT*/
- {
- FILE *fp;
- int sresult;
- fp = fopen(m_paths[m_filestack.front().m_str].c_str(),"rb");
-
- if(fp == NULL)
- {
- /*
- ** someone gave this process a hot foot?
- */
- return -1;
- }
- sresult = fseek(fp,m_filestack.front().nwritten,SEEK_SET);
-
- if(sresult < 0)
- {
- /*
- ** someone gave this process a hot foot?
- */
- fclose(fp);
- return -1;
- }
-
- if(((m_content_length[m_filestack.front().m_str] - m_filestack.front().nwritten)) > (unsigned long)m_con->send_bytes_available())
- {
- ntowrite = m_con->send_bytes_available();
- }
- else
- {
- ntowrite = (m_content_length[m_filestack.front().m_str] - m_filestack.front().nwritten);
- }
-
- char *b=NULL;
-
- b = (char *)malloc(ntowrite);
-
- if(b == NULL)
- {
- return -1;
- /*
- ** whiskey tango foxtrot
- */
- }
- /*
- ** read from where we left off
- */
- sresult = fread(b,1,ntowrite,fp);
-
- if(sresult != ntowrite)
- {
- /*
- ** hot foot with matches again
- */
- if(b)
- {
- free(b);
- }
- fclose(fp);
- return -1;
- }
-
- fclose(fp);
-
- retval = m_con->send(b,ntowrite);
-
- free(b);
-
- if(retval < 0)
- {
- return retval;
- }
-
- m_filestack.front().nwritten += ntowrite;
-
- m_nwritten += ntowrite;
-
- if(m_filestack.front().nwritten == m_content_length[m_filestack.front().m_str])
- {
- m_filestack.pop_front();
- }
- }
- break;
- }
- } while(!stop);
-
- return JNL_HTTPGet::run();
-}
-/*
-** addfield, adds field
-*/
-int JNL_HTTPPost::addfield(char *name, char *val)
-{
- if(name == NULL || val == NULL)
- {
- return -1;
- }
- m_fields[name]=val;
-
- return 0;
-}
-/*
-** addfile, adds file
-*/
-int JNL_HTTPPost::addfile(char *name, char *mimetype, char *filename, char *filepath)
-{
- struct stat buffer;
-
- FILE *fp=NULL;
- if(name==NULL || filepath == NULL || mimetype == NULL || filename == NULL || (!(fp=fopen(filepath,"rb"))))
- {
- return -1;
- }
-
- m_content_type[name] = mimetype;
- m_paths[name] = filepath;
- m_filenames[name] = filename;
-
- fstat(fileno(fp),&buffer);
- fclose(fp);
- m_content_length[name] = buffer.st_size;
-
- return 0;
-}
-/*
-** After adding fields and files, get the content length
-*/
-int JNL_HTTPPost::contentlength()
-{
- std::map::iterator it;
- std::string tmp;
- int length = 0;
-// fields
- {
- for (it = m_fields.begin(); it != m_fields.end(); it++)
- {
- std::string name = (*it).first;
- std::string value = (*it).second;
-
- tmp = "--" + m_boundary + "\r\n"
- "content-disposition: form-data; name=\"" + name + "\"\r\n"
- "\r\n";
- tmp += value + "\r\n";
-
- length += tmp.size();
- }
- }
-
- // files
- {
- for (it = m_filenames.begin(); it != m_filenames.end(); it++)
- {
- std::string name = (*it).first;
- std::string filename = (*it).second;
- long content_length = m_content_length[name];
- std::string content_type = m_content_type[name];
- tmp = "--" + m_boundary + "\r\n"
- "content-disposition: form-data; name=\"" + name + "\"; filename=\"" + filename + "\"\r\n"
- "content-type: " + content_type + "\r\n"
- "\r\n";
- length += tmp.size();
- length += content_length;
- length += 2; // crlf after file
- }
- }
-
- // end
- tmp = "--" + m_boundary + "--\r\n";
- length += tmp.size();
-
- return length;
-
-}
-void JNL_HTTPPost::_addformheader()
-{
- char *h;
-#ifdef _WIN32
- srand(GetTickCount());
-#else
- srand(time(NULL));
-#endif
-
- int x;
- char *preamble = "content-type:multipart/form-data; boundary=";
- char *dashes = "----";
-
- char *post_boundary = (char*)alloca(10+strlen(dashes));
- memcpy(post_boundary,dashes,strlen(dashes));
-
- for(x=strlen(dashes); x < (int)strlen(dashes)+9; x++)
- {
- post_boundary[x] = (char)(rand() % 9) + '0';
- }
- post_boundary[x] = 0;
-
- h = (char *)alloca(strlen(preamble) + strlen(post_boundary) + 1);
- sprintf(h,"%s%s",preamble,post_boundary);
- addheader(h);
- m_boundary = post_boundary;
-}
diff --git a/Frameworks/JNetLib/jnetlib/httppost.h b/Frameworks/JNetLib/jnetlib/httppost.h
deleted file mode 100755
index c7351de28..000000000
--- a/Frameworks/JNetLib/jnetlib/httppost.h
+++ /dev/null
@@ -1,129 +0,0 @@
-
-/*
-** JNetLib
-** Copyright (C) Joshua Teitelbaum, sergent first class, 1014 army.
-** Author: Joshua Teitelbaum
-** File: httppost.cpp/h
-** License: see jnetlib.h
-** Usage:
-** 1. Create a JNL_HTTPPost object, optionally specifying a JNL_AsyncDNS
-** object to use (or NULL for none, or JNL_CONNECTION_AUTODNS for auto),
-** and the receive buffer size, and a string specifying proxy (or NULL
-** for none). See note on proxy string below.
-** 2. call addheader() to add whatever headers you want. It is recommended to
-** add at least the following two:
-** addheader("User-Agent:MyApp (Mozilla)");
-*/// addheader("Accept:*/*");
-/* Joshua Teitelbaum 1/15/2006
-** 2.5 call addfield to add field items to your POST
-** 2.9 call addfile to add file items to your POST
-*/
-/* ( the comment weirdness is there so I Can do the star-slash :)
-** 3. Call connect() with the URL you wish to Post (see URL string note below)
-** 4. Call run() once in a while, checking to see if it returns -1
-** (if it does return -1, call geterrorstr() to see what the error is).
-** (if it returns 1, no big deal, the connection has closed).
-** 5. While you're at it, you can call bytes_available() to see if any data
-** from the http stream is available, or getheader() to see if any headers
-** are available, or getreply() to see the HTTP reply, or getallheaders()
-** to get a double null terminated, null delimited list of headers returned.
-** 6. If you want to read from the stream, call get_bytes (which returns how much
-** was actually read).
-** 7. content_length() is a helper function that uses getheader() to check the
-** content-length header.
-** 8. Delete ye' ol' object when done.
-**
-** Proxy String:
-** should be in the format of host:port, or user@host:port, or
-** user:password@host:port. if port is not specified, 80 is assumed.
-** URL String:
-** should be in the format of http://user:pass@host:port/requestwhatever
-** note that user, pass, port, and /requestwhatever are all optional :)
-** note that also, http:// is really not important. if you do poo://
-** or even leave out the http:// altogether, it will still work.
-*/
-
-#ifndef _HTTPPOST_H_
-#define _HTTPPOST_H_
-
-#include "connection.h"
-#include "httpget.h"
-/*
-** VC6 SPEW
-*/
-#pragma warning(disable:4786)
-/*
-** END VC6 SPEW
-*/
-#include
-#include
-#include