Skip to content

Commit b6fd275

Browse files
committed
FIxed small bugs....
1 parent 1ec7055 commit b6fd275

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

Test/fuzzingclient.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"options": {"version": 18}}
1111
],
1212

13-
"cases": ["1.*","2.*","3.*","4.*", "5.*", "6.*", "7.*", "9.*", "10.*"],
13+
"cases": ["1.*","2.*","3.*","4.*", "5.*", "6.*", "7.*", "9.*", "10.*"],
1414
"exclude-cases": [],
1515
"exclude-agent-cases": {}
1616
}

Test/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,12 +252,12 @@ void multithreadthroughputtest() {
252252
int main(int argc, char* argv[]) {
253253
wssautobahntest();
254254
std::this_thread::sleep_for(1s);
255-
generaltest();
255+
/*generaltest();
256256
std::this_thread::sleep_for(1s);
257257
generalTLStest();
258258
std::this_thread::sleep_for(1s);
259259
multithreadtest();
260260
std::this_thread::sleep_for(1s);
261-
multithreadthroughputtest();
261+
multithreadthroughputtest();*/
262262
return 0;
263263
}

include/internal/DataStructures.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ namespace SL {
156156
}
157157
unsigned char* ReceiveBuffer = nullptr;
158158
size_t ReceiveBufferSize = 0;
159-
unsigned char ReceiveHeader[14];
159+
unsigned char ReceiveHeader[14] = {};
160160
bool CompressionEnabled = false;
161161

162162
OpCode LastOpCode = OpCode::INVALID;

include/internal/Utils.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,16 @@ namespace SL {
7474

7575

7676
template<class PARENTTYPE>inline bool DidPassMaskRequirement(unsigned char* h) { UNUSED(h); return true; }
77-
template<> inline bool DidPassMaskRequirement<WSListenerImpl>(unsigned char* h) { return getMask(h); }
78-
template<> inline bool DidPassMaskRequirement<WSClientImpl>(unsigned char* h) { return !getMask(h); }
77+
template<> inline bool DidPassMaskRequirement<std::shared_ptr<WSListenerImpl>>(unsigned char* h) { return getMask(h); }
78+
template<> inline bool DidPassMaskRequirement<std::shared_ptr<WSClientImpl>>(unsigned char* h) { return !getMask(h); }
7979

8080
template<class PARENTTYPE>inline size_t AdditionalBodyBytesToRead() { return 0; }
81-
template<>inline size_t AdditionalBodyBytesToRead<WSListenerImpl>() { return 4; }
82-
template<>inline size_t AdditionalBodyBytesToRead<WSClientImpl>() { return 0; }
81+
template<>inline size_t AdditionalBodyBytesToRead<std::shared_ptr<WSListenerImpl>>() { return 4; }
82+
template<>inline size_t AdditionalBodyBytesToRead<std::shared_ptr<WSClientImpl >>() { return 0; }
8383

84-
template<class PARENTTYPE>inline void set_MaskBitForSending(unsigned char* frame) { }
85-
template<>inline void set_MaskBitForSending<WSListenerImpl>(unsigned char* frame) { setMask(frame, 0x00); }
86-
template<>inline void set_MaskBitForSending<WSClientImpl>(unsigned char* frame) { setMask(frame, 0xff); }
84+
template<class PARENTTYPE>inline void set_MaskBitForSending(unsigned char* frame) { UNUSED(frame); }
85+
template<>inline void set_MaskBitForSending<std::shared_ptr<WSListenerImpl>>(unsigned char* frame) { setMask(frame, 0x00); }
86+
template<>inline void set_MaskBitForSending<std::shared_ptr<WSClientImpl >>(unsigned char* frame) { setMask(frame, 0xff); }
8787

8888
template<class T>std::string get_address(T& _socket)
8989
{

include/internal/WebSocketProtocol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ namespace SL {
150150
write_end(parent, socket, msg);
151151
}
152152

153-
template<class PARENTTYPE, class SOCKETTYPE, class SENDBUFFERTYPE>inline void write(const std::shared_ptr<PARENTTYPE>& parent, const SOCKETTYPE& socket, const SENDBUFFERTYPE& msg) {
153+
template<class PARENTTYPE, class SOCKETTYPE, class SENDBUFFERTYPE>inline void write(const PARENTTYPE& parent, const SOCKETTYPE& socket, const SENDBUFFERTYPE& msg) {
154154
size_t sendsize = 0;
155155
unsigned char header[10] = {};
156156

@@ -273,7 +273,7 @@ namespace SL {
273273
}
274274
return closeImpl(parent, socket, 1000, "");
275275
}
276-
template <class PARENTTYPE, class SOCKETTYPE>inline void ProcessControlMessage(const std::shared_ptr<PARENTTYPE>& parent, const SOCKETTYPE& socket, const std::shared_ptr<unsigned char>& buffer, size_t size) {
276+
template <class PARENTTYPE, class SOCKETTYPE>inline void ProcessControlMessage(const PARENTTYPE& parent, const SOCKETTYPE& socket, const std::shared_ptr<unsigned char>& buffer, size_t size) {
277277
if (!getFin(socket->ReceiveHeader)) {
278278
return closeImpl(parent, socket, 1002, "Closing connection. Control Frames must be Fin");
279279
}

0 commit comments

Comments
 (0)