iOS HttpClient replace libcurl - fix Jenkins compile error

This commit is contained in:
huangshiwu 2014-12-31 11:32:35 +08:00
parent 7426b5c4b5
commit 893aded9b7
5 changed files with 11 additions and 11 deletions

View File

@ -1750,7 +1750,7 @@
52B47A1E1A53489B004E4C60 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A1D1A53489B004E4C60 /* HttpClient.cpp */; }; 52B47A1E1A53489B004E4C60 /* HttpClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A1D1A53489B004E4C60 /* HttpClient.cpp */; };
52B47A2E1A5349A3004E4C60 /* HttpAsynConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */; }; 52B47A2E1A5349A3004E4C60 /* HttpAsynConnection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */; };
52B47A2F1A5349A3004E4C60 /* HttpAsynConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */; }; 52B47A2F1A5349A3004E4C60 /* HttpAsynConnection.m in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */; };
52B47A301A5349A3004E4C60 /* HttpClientIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2B1A5349A3004E4C60 /* HttpClientIOS.mm */; }; 52B47A301A5349A3004E4C60 /* HttpClient-ios.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */; };
52B47A311A5349A3004E4C60 /* HttpCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */; }; 52B47A311A5349A3004E4C60 /* HttpCookie.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */; };
52B47A321A5349A3004E4C60 /* HttpCookie.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A2D1A5349A3004E4C60 /* HttpCookie.h */; }; 52B47A321A5349A3004E4C60 /* HttpCookie.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B47A2D1A5349A3004E4C60 /* HttpCookie.h */; };
5E9F61261A3FFE3D0038DE01 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */; }; 5E9F61261A3FFE3D0038DE01 /* CCFrustum.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */; };
@ -2935,7 +2935,7 @@
52B47A1D1A53489B004E4C60 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; }; 52B47A1D1A53489B004E4C60 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; };
52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpAsynConnection.h; sourceTree = "<group>"; }; 52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpAsynConnection.h; sourceTree = "<group>"; };
52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynConnection.m; sourceTree = "<group>"; }; 52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynConnection.m; sourceTree = "<group>"; };
52B47A2B1A5349A3004E4C60 /* HttpClientIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = HttpClientIOS.mm; sourceTree = "<group>"; }; 52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = "HttpClient-ios.mm"; sourceTree = "<group>"; };
52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpCookie.cpp; sourceTree = "<group>"; }; 52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpCookie.cpp; sourceTree = "<group>"; };
52B47A2D1A5349A3004E4C60 /* HttpCookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpCookie.h; sourceTree = "<group>"; }; 52B47A2D1A5349A3004E4C60 /* HttpCookie.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpCookie.h; sourceTree = "<group>"; };
5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrustum.cpp; sourceTree = "<group>"; }; 5E9F61221A3FFE3D0038DE01 /* CCFrustum.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCFrustum.cpp; sourceTree = "<group>"; };
@ -3915,7 +3915,7 @@
children = ( children = (
52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */, 52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */,
52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */, 52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */,
52B47A2B1A5349A3004E4C60 /* HttpClientIOS.mm */, 52B47A2B1A5349A3004E4C60 /* HttpClient-ios.mm */,
52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */, 52B47A2C1A5349A3004E4C60 /* HttpCookie.cpp */,
52B47A2D1A5349A3004E4C60 /* HttpCookie.h */, 52B47A2D1A5349A3004E4C60 /* HttpCookie.h */,
52B47A1D1A53489B004E4C60 /* HttpClient.cpp */, 52B47A1D1A53489B004E4C60 /* HttpClient.cpp */,
@ -6907,7 +6907,7 @@
1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */, 1A570072180BC5A10088DEC7 /* CCActionGrid.cpp in Sources */,
15AE1ABC19AAD40300C27E9E /* b2PolygonAndCircleContact.cpp in Sources */, 15AE1ABC19AAD40300C27E9E /* b2PolygonAndCircleContact.cpp in Sources */,
15AE1ADA19AAD41000C27E9E /* b2Rope.cpp in Sources */, 15AE1ADA19AAD41000C27E9E /* b2Rope.cpp in Sources */,
52B47A301A5349A3004E4C60 /* HttpClientIOS.mm in Sources */, 52B47A301A5349A3004E4C60 /* HttpClient-ios.mm in Sources */,
B29A7E1619EE1B7700872B35 /* BoundingBoxAttachment.c in Sources */, B29A7E1619EE1B7700872B35 /* BoundingBoxAttachment.c in Sources */,
382384081A25900F002C4610 /* FlatBuffersSerialize.cpp in Sources */, 382384081A25900F002C4610 /* FlatBuffersSerialize.cpp in Sources */,
DABC9FAA19E7DFA900FA252C /* CCClippingRectangleNode.cpp in Sources */, DABC9FAA19E7DFA900FA252C /* CCClippingRectangleNode.cpp in Sources */,

View File

@ -794,6 +794,7 @@
527B1F4419EFAE13000A1F82 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4219EFAE13000A1F82 /* Default-667h@2x.png */; }; 527B1F4419EFAE13000A1F82 /* Default-667h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4219EFAE13000A1F82 /* Default-667h@2x.png */; };
527B1F4519EFAE13000A1F82 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4319EFAE13000A1F82 /* Default-736h@3x.png */; }; 527B1F4519EFAE13000A1F82 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 527B1F4319EFAE13000A1F82 /* Default-736h@3x.png */; };
52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; }; 52B47A341A534B2B004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; };
52B47A351A53A43A004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A331A534B2B004E4C60 /* Security.framework */; };
59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; 59620E8F1921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; }; 59620E901921E5CF002021B6 /* Bug-Child.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 59620E8D1921E5CF002021B6 /* Bug-Child.cpp */; };
5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBEECAE1995247000429821 /* DrawNode3D.cpp */; }; 5EBEECB01995247000429821 /* DrawNode3D.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EBEECAE1995247000429821 /* DrawNode3D.cpp */; };
@ -1875,6 +1876,7 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
52B47A351A53A43A004E4C60 /* Security.framework in Frameworks */,
15AE17DC19A725A000C27E9E /* libcurl.a in Frameworks */, 15AE17DC19A725A000C27E9E /* libcurl.a in Frameworks */,
15EFA66F198B356E000C57D3 /* libluacocos2d iOS.a in Frameworks */, 15EFA66F198B356E000C57D3 /* libluacocos2d iOS.a in Frameworks */,
15EFA666198B34D7000C57D3 /* libcocos2d iOS.a in Frameworks */, 15EFA666198B34D7000C57D3 /* libcocos2d iOS.a in Frameworks */,

View File

@ -95,8 +95,6 @@ void HttpClient::networkThread()
if (request == s_requestSentinel) { if (request == s_requestSentinel) {
break; break;
} }
// step 2: libcurl sync access
// Create a HttpResponse object, the default setting is http access failed // Create a HttpResponse object, the default setting is http access failed
HttpResponse *response = new (std::nothrow) HttpResponse(request); HttpResponse *response = new (std::nothrow) HttpResponse(request);
@ -198,7 +196,7 @@ static int processTask(HttpRequest *request, NSString* requestType, void *stream
//read cookie propertities from file and set cookie //read cookie propertities from file and set cookie
if(!s_cookieFilename.empty()) if(!s_cookieFilename.empty())
{ {
CookiesInfo* cookieInfo = s_cookie->getMatchCookie(request->getUrl()); const CookiesInfo* cookieInfo = s_cookie->getMatchCookie(request->getUrl());
if(cookieInfo != nullptr) if(cookieInfo != nullptr)
{ {
NSString *domain = [NSString stringWithCString:cookieInfo->domain.c_str() encoding:[NSString defaultCStringEncoding]]; NSString *domain = [NSString stringWithCString:cookieInfo->domain.c_str() encoding:[NSString defaultCStringEncoding]];

View File

@ -88,12 +88,12 @@ void HttpCookie::readFile()
} }
} }
std::vector<CookiesInfo>* HttpCookie::getCookies() const std::vector<CookiesInfo>* HttpCookie::getCookies() const
{ {
return &_cookies; return &_cookies;
} }
CookiesInfo* HttpCookie::getMatchCookie(const std::string& url) const CookiesInfo* HttpCookie::getMatchCookie(const std::string& url) const
{ {
for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++) for(auto iter = _cookies.begin(); iter != _cookies.end(); iter++)
{ {

View File

@ -44,8 +44,8 @@ public:
void writeFile(); void writeFile();
void setCookieFileName(const std::string fileName); void setCookieFileName(const std::string fileName);
std::vector<CookiesInfo>* getCookies(); const std::vector<CookiesInfo>* getCookies()const;
CookiesInfo* getMatchCookie(const std::string& url); const CookiesInfo* getMatchCookie(const std::string& url) const;
void updateOrAddCookie(CookiesInfo* cookie); void updateOrAddCookie(CookiesInfo* cookie);
private: private: