Skip to content

Commit

Permalink
fix ios
Browse files Browse the repository at this point in the history
  • Loading branch information
irov committed Dec 3, 2024
1 parent 6323871 commit b90c6ab
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/Systems/AppleFileSystem/AppleFileSystem.mm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ static bool isDirectoryFullpath( const Char * _fullpath )
Path correctDirectory = {'\0'};
Helper::pathCorrectBackslashToA( correctDirectory, _directory );

Helper::pathRemoveFileSpecA( correctDirectory, MENGINE_PATH_DELIM_BACKSLASH );

size_t correctDirectoryLen = StdString::strlen( correctDirectory );

if( correctDirectoryLen == 0 )
Expand Down
6 changes: 4 additions & 2 deletions src/Systems/AppleHttpSystem/AppleHttpRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,23 @@ namespace Mengine
: public BaseHttpRequest
{
public:
AppleHttpRequest();
AppleHttpRequest( bool _isJSON );
~AppleHttpRequest() override;

protected:
void _onThreadTaskPreparation() override;
bool _onThreadTaskRun() override;
bool _onThreadTaskProcess() override;

protected:
virtual MengineHttpResponseParam * _onHttp( MengineHttpRequestParam * request ) = 0;

protected:
void _onThreadTaskComplete( bool _successful ) override;

protected:
bool m_isJSON;

ThreadMutexInterfacePtr m_mutex;
};
//////////////////////////////////////////////////////////////////////////
Expand Down
14 changes: 11 additions & 3 deletions src/Systems/AppleHttpSystem/AppleHttpRequest.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
namespace Mengine
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequest::AppleHttpRequest()
AppleHttpRequest::AppleHttpRequest( bool _isJSON )
: m_isJSON( _isJSON )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -81,9 +82,16 @@

if( response.HTTP_CONTENT_DATA != nullptr )
{
const Char * bytes = (const Char *)[response.HTTP_CONTENT_DATA bytes];
const void * bytes = [response.HTTP_CONTENT_DATA bytes];

m_response->appendData( bytes, response.HTTP_CONTENT_LENGTH );
if( m_isJSON == true )
{
m_response->appendJSON( bytes, response.HTTP_CONTENT_LENGTH );
}
else
{
m_response->appendData( bytes, response.HTTP_CONTENT_LENGTH );
}
}

if( response.HTTP_ERROR_MESSAGE != nullptr )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestDeleteMessage::AppleHttpRequestDeleteMessage()
: AppleHttpRequest( true )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/Systems/AppleHttpSystem/AppleHttpRequestGetAsset.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestGetAsset::AppleHttpRequestGetAsset()
: AppleHttpRequest( false )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/Systems/AppleHttpSystem/AppleHttpRequestGetMessage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestGetMessage::AppleHttpRequestGetMessage()
: AppleHttpRequest( true )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/Systems/AppleHttpSystem/AppleHttpRequestHeaderData.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestHeaderData::AppleHttpRequestHeaderData()
: AppleHttpRequest( true )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/Systems/AppleHttpSystem/AppleHttpRequestPing.mm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestPing::AppleHttpRequestPing()
: AppleHttpRequest( true )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down
1 change: 1 addition & 0 deletions src/Systems/AppleHttpSystem/AppleHttpRequestPostMessage.mm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
{
//////////////////////////////////////////////////////////////////////////
AppleHttpRequestPostMessage::AppleHttpRequestPostMessage()
: AppleHttpRequest( true )
{
}
//////////////////////////////////////////////////////////////////////////
Expand Down

0 comments on commit b90c6ab

Please sign in to comment.