Commit Graph

672 Commits

Author SHA1 Message Date
Benjamin Sergeant
3baf59a031 (ws) bump CLI command line parsing library from 1.8 to 2.0 2021-07-27 20:48:25 +02:00
Benjamin Sergeant
30bcddb99f (ws) ws connect has a -g option to gzip decompress messages for API such as the websocket Huobi Global. 2021-06-08 09:49:27 -07:00
Benjamin Sergeant
47fd04e210 (websocket client + server) WebSocketMessage class tweak to fix unsafe patterns 2021-06-08 09:47:53 -07:00
Nikos Athanasiou
4f5b0c4f07
Noexcept ix web socket per message deflate options (#299)
* Fix unsafe calls and safeguard WebSocketMessage from being called w/
temporaries

* Use unnamed namespace to express internal linkage

* Avoid returning references that are mutex protected
Motivation for this MR

The antipattern of returning references to mutex protected members was
removed. Since a caller can hold the reference it would make all class
level locking meaningless.

Instead values are returned. The IXWebSocketPerMessageDeflateOptions
class was shrunk by 7 bytes (1 padding + 2*3) after changing the int
members to the used uint8_t; side effects of that were handled.

An inefficient "string -> int" was replaced by standard library. As
seen here http://coliru.stacked-crooked.com/a/46b5990bafb9c626 this
gives an order of magnitude better performance.

* noexcept string to integer conversion
2021-06-07 11:19:52 -07:00
Nikos Athanasiou
c2d497abc5
Avoid returning references that are mutex protected (#297)
* Fix unsafe calls and safeguard WebSocketMessage from being called w/
temporaries

* Use unnamed namespace to express internal linkage

* Avoid returning references that are mutex protected
Motivation for this MR

The antipattern of returning references to mutex protected members was
removed. Since a caller can hold the reference it would make all class
level locking meaningless.

Instead values are returned. The IXWebSocketPerMessageDeflateOptions
class was shrunk by 7 bytes (1 padding + 2*3) after changing the int
members to the used uint8_t; side effects of that were handled.

An inefficient "string -> int" was replaced by standard library. As
seen here http://coliru.stacked-crooked.com/a/46b5990bafb9c626 this
gives an order of magnitude better performance.
2021-06-05 11:23:18 -07:00
crjc
bbe2ae6dd3
fix: check the request's headers rather than the empty response's headers for User-Agent and Accept (#296) 2021-06-05 11:19:53 -07:00
Nikos Athanasiou
26897b2425
Fix unsafe calls and safeguard WebSocketMessage (#294)
* Fix unsafe calls and safeguard WebSocketMessage from being called w/
temporaries

* Use unnamed namespace to express internal linkage
2021-06-03 18:39:38 -07:00
Benjamin Sergeant
e3c98a03cc (websocket server) Handle and accept firefox browser special upgrade value (keep-alive, Upgrade) 2021-05-27 10:54:21 -07:00
Benjamin Sergeant
97fedf9482 (Windows) move EINVAL (re)definition from IXSocket.h to IXNetSystem.h (fix #289) 2021-05-27 10:54:21 -07:00
Benjamin Sergeant
0f21a20fe3 Move errno windows definitions to IXNetSystem.h 2021-05-17 19:04:02 -07:00
flagarde
0e0a748037
Remove warnings (#284) 2021-04-19 09:25:06 -07:00
Benjamin Sergeant
3b19b0eeca http client: DEL is not a verb, but DELETE is, fix #281 2021-04-04 23:27:28 -07:00
Benjamin Sergeant
d932af8568 (cmake) install IXUniquePtr.h 2021-03-25 10:55:59 -07:00
Benjamin Sergeant
3add6d4c2e (ssl + windows) missing include for CertOpenStore function 2021-03-24 08:03:56 -07:00
Benjamin Sergeant
0d7fb05567 (ixwebsocket) version bump 2021-03-23 21:54:54 -07:00
Benjamin Sergeant
bf1747ef18 (ixwebsocket) version bump 2021-03-23 21:54:15 -07:00
Benjamin Sergeant
5c9c05caff bump version 2021-03-23 21:52:49 -07:00
Benjamin Sergeant
2573ca151b CaseInsensitiveLess::NocaseCompare::operator mingw fix attempt 2021-03-23 21:21:36 -07:00
Benjamin Sergeant
c5b5fa82be use inet_* wrapper only on mingw 2021-03-23 21:13:18 -07:00
Benjamin Sergeant
24c2eae3d7 use inet_ntop and inet_pton musl implementations on all platforms 2021-03-23 20:53:19 -07:00
Benjamin Sergeant
449c5fa138 (ixwebsocket) add getMinWaitBetweenReconnectionRetries 2021-03-23 08:29:50 -07:00
Benjamin Sergeant
b6234ff908 compile errors due to missing changes for the introduction of setMinWaitBetweenReconnectionRetries and getMinWaitBetweenReconnectionRetries 2021-03-23 08:28:40 -07:00
Benjamin Sergeant
d26664fccc (ixwebsocket) New option to set the min wait between reconnection attempts. Still default to 1ms. (setMinWaitBetweenReconnectionRetries). 2021-03-23 07:33:48 -07:00
Benjamin Sergeant
def0243d6d (ws) initialize maxWaitBetweenReconnectionRetries to a non zero value ; a zero value was causing spurious reconnections attempts 2021-03-22 21:10:18 -07:00
Benjamin Sergeant
4d7b149649 mingw: cast fixes 2021-03-21 10:16:06 -07:00
Benjamin Sergeant
b29a37ce76 mingw: inet_ntop and inet_pton compilation fix, use correct parameter names 2021-03-21 09:50:15 -07:00
Benjamin Sergeant
9a4dfb40da mingw: add real implementation of inet_ntop and inet_pton taken from musl C library 2021-03-21 09:43:16 -07:00
Benjamin Sergeant
d706a4a73e doc: document BUILD_SHARED_LIBS 2021-03-20 09:50:21 -07:00
Benjamin Sergeant
88970604e3 ixwebsocketserver::broadcast server to return a boolean to know whether the server could start/listen, and use that in ws 2021-03-19 11:52:41 -07:00
Benjamin Sergeant
7fee54464e WebSocketServer::listenAndStart: fix branch where we do not return an integer 2021-03-19 11:48:21 -07:00
Benjamin Sergeant
b36a2d1faa mingw compile fix / remove restrict in inet_* functions 2021-03-19 10:58:38 -07:00
Benjamin Sergeant
0813eb1788 mention disablePerMessageDeflate in the doc 2021-03-16 09:56:08 -07:00
Benjamin Sergeant
7fd782f72f add WIN32_LEAN_AND_MEAN windows blip 2021-03-15 19:58:18 -07:00
Benjamin Sergeant
85bcdaaec3 stub inet_ntop and inet_pton function that mingw does not have 2021-03-14 14:25:40 -07:00
Benjamin Sergeant
6a7785d9d9 no set thread name on mingw 2021-03-13 19:02:20 -08:00
Benjamin Sergeant
78a670e0c8 more mingw quirks 2021-03-13 18:55:30 -08:00
Benjamin Sergeant
e63ac69ec6 mock poll struct and macro for mingw 2021-03-13 18:49:29 -08:00
Benjamin Sergeant
afa15d6dcf mingw build problem fix attempt 2021-03-13 18:31:42 -08:00
Benjamin Sergeant
f090c7659b (ixwebsocket) Expose setHandshakeTimeout method 2021-03-07 19:29:28 -08:00
Benjamin Sergeant
7c195219cd reorder methods in IXWebSocket.h 2021-03-07 19:25:53 -08:00
Duncan Ogilvie
d739662a7c
Allow customizing the websocket handshake timeout (#264) 2021-03-07 19:23:43 -08:00
Benjamin Sergeant
39cc0ed32f add comment in WebSocketServer::makeBroadcastServer 2021-01-28 21:04:18 -08:00
Benjamin Sergeant
f6e34e4b34 stop using C++14 lambda capture init, code should be C++11 compatible 2021-01-03 11:44:05 -08:00
Benjamin Sergeant
d0359a1764 new makeBroadcastServer websocket server method for classic servers, used by ws 2021-01-03 11:24:12 -08:00
Benjamin Sergeant
fabc07d598 (ws) trim ws dependencies no more ixcrypto and ixcore deps 2020-12-25 16:25:58 -08:00
Benjamin Sergeant
0b7919834a (ws) trim ws dependencies, only depends on ixcrypto and ixcore 2020-12-25 15:17:46 -08:00
Benjamin Sergeant
1d0432c8c5 (build) rename makefile to makefile.dev to ease cmake BuildExternal (fix #261) 2020-12-22 21:42:39 -08:00
Benjamin Sergeant
461a645704 (ws) Implement simple header based websocket authorization technique to reject 2020-12-17 22:42:14 -08:00
Benjamin Sergeant
93ad709dfd fix ws curl error message + some Windows warnings 2020-12-12 11:01:22 -08:00
Benjamin Sergeant
75e9c84388 fix buggy message and remove un-needed include 2020-11-19 14:27:10 -08:00