1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-24 04:04:31 +00:00

Fixed bug, where Packet Validation failed, because HttpStream was always configured as server.

This commit is contained in:
Bryan Roe
2019-03-27 15:00:39 -07:00
parent 4bc5619137
commit 31be55c945
2 changed files with 20 additions and 5 deletions

View File

@@ -227,7 +227,7 @@ typedef struct ILibWebClientDataObject
int BytesLeft;
int WaitForClose;
int Closing;
int Server;
int Server; // 0 = Client, 1 = Server, 2 = Server, but ignore header checks
int DisconnectSent;
int HeaderLength;
@@ -314,6 +314,10 @@ typedef struct ILibWebClient_WebSocketState
void* pingPongUser;
}ILibWebClient_WebSocketState;
int *ILibWebClient_WCDO_ServerFlag(ILibWebClient_StateObject j)
{
return(&(((ILibWebClientDataObject*)j)->Server));
}
void ILibWebClient_Timeout_Sink(ILibAsyncSocket_SocketModule module, void *user)
{
@@ -1592,7 +1596,7 @@ ILibWebClient_DataResults ILibWebClient_OnData(ILibAsyncSocket_SocketModule sock
}
if (wcdo->header != NULL)
{
if (wcdo->header->Directive == NULL && wcdo->header->StatusCode != -1 && wcdo->Server != 0)
if (wcdo->header->Directive == NULL && wcdo->header->StatusCode != -1 && wcdo->Server == 1)
{
return(ILibWebClient_DataResults_InvalidRequest); // We're a server, but we received a Response Packet...
}