Skip to content

Commit

Permalink
fixed http header bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jehoochen committed Jul 7, 2017
1 parent d60f006 commit 9b95afa
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
5 changes: 4 additions & 1 deletion mars/app/app_logic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,16 @@

#include "mars/app/app_logic.h"

#ifdef __APPLE__
#include <TargetConditionals.h>
#endif

#include "mars/comm/xlogger/xlogger.h"
#include "mars/comm/bootrun.h"
#include "mars/comm/thread/mutex.h"
#include "mars/comm/thread/lock.h"
#include "mars/comm/thread/thread.h"
#include "mars/comm/time_utils.h"
#include "mars/comm/dns/dns.h"
#include "mars/baseevent/baseprjevent.h"

Expand Down Expand Up @@ -125,7 +128,7 @@ void SetCallback(Callback* const callback) {

#if !TARGET_OS_IPHONE
mars::comm::ProxyInfo proxy_info;
sg_callback->GetProxyInfo(_host, proxy_info)
sg_callback->GetProxyInfo(_host, proxy_info);
return proxy_info;
#endif

Expand Down
4 changes: 2 additions & 2 deletions mars/app/win32proj/app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<ForcedIncludeFiles>mars/comm/projdef.h</ForcedIncludeFiles>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalOptions>/Zc:threadSafeInit- %(AdditionalOptions)</AdditionalOptions>
<AdditionalIncludeDirectories>$(ProjectDir)../../../;$(ProjectDir)../../comm/windows/</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)../../comm/;$(ProjectDir)../../;$(ProjectDir)../../../;$(ProjectDir)../../comm/windows/</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand All @@ -79,7 +79,7 @@
<ForcedIncludeFiles>mars/comm/projdef.h</ForcedIncludeFiles>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<AdditionalIncludeDirectories>$(ProjectDir)../../../;$(ProjectDir)../../comm/windows/</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(ProjectDir)../../comm/;$(ProjectDir)../../;$(ProjectDir)../../../;$(ProjectDir)../../comm/windows/</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
Expand Down
2 changes: 0 additions & 2 deletions mars/comm/http.cc
Original file line number Diff line number Diff line change
Expand Up @@ -701,9 +701,7 @@ Parser::TRecvStatus Parser::Recv(const void* _buffer, size_t _length) {
return recvstatus_;
}

recvstatus_ = kHeaderFields;
headerbuf_.Write(recvbuf_.Ptr(), firstlinelength);
recvbuf_.Move(- firstlinelength);
// HTTP/1.1 4.7 Unauthorized\r\n\r\n
char* pos_2crlf = string_strnstr(pBuf, "\r\n\r\n", (int)recvbuf_.Length());
if (NULL != pos_2crlf && pos_2crlf == pos) {
Expand Down
1 change: 1 addition & 0 deletions mars/comm/windows/thread/lock.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "assert/__assert.h"
#include "thread/mutex.h"
#include "thread/spinlock.h"
#include "unistd.h"

template <typename MutexType>
class BaseScopedLock {
Expand Down

0 comments on commit 9b95afa

Please sign in to comment.