summaryrefslogtreecommitdiff
path: root/modules/websocket/wsl_client.cpp
AgeCommit message (Collapse)Author
2022-05-16Replace most uses of Map by HashMapreduz
* Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
2022-05-04[WebSocket] Fix WSLClient connection status.Fabio Alessandrelli
Note, this keeps the old behaviour of reporting CONNECTION_CONNECTED while disconnecting. We should change this before 4.0, but needs further refactoring of the WebSocket classes.
2022-05-03Merge pull request #60444 from snailrhymer/expand-websocketclient-error-messagesFabio Alessandrelli
Add detail to some error messages in wsl_client
2022-04-22Add detail to some error messages in wsl_clientSnailRhymer
Add messages, and add expected and actual values to other messages in _verify_headers for easier troubleshooting.
2022-03-27[Net] Drop is_connected_to_host for TCP and UDP.Fabio Alessandrelli
The UDP method is now called `is_socket_connected` to limit confusion with the actual host connection status which doesn't make sense in UDP. The TCP method is completly dropped, use get_status instead. The only one left is the WebSocketPeer one, which should be fine as is for now.
2022-03-27[Net] Make StreamPeerTCP::_poll_connection explicit.Fabio Alessandrelli
No longer hacked into `get_status` and renamed to `poll`. The old `poll` (for *nix `poll`, win `select`) is now called `wait`.
2022-02-10Fix typos with codespellRémi Verschelde
Using codespell 2.2-dev from current git. Added `misc/scripts/codespell.sh` to make it easier to run it once in a while and update the skip and ignore lists.
2022-02-05[Net] Non-blocking WebSocket hostname resolution.Jordan Schidlowsky
Hostname is now resolved during poll in WebSocketClient (wslay) to avoid blocking during connect. An attempt is still made to find the hostname in the resolver cache.
2022-01-20Rename or refactor macros to avoid leading underscoresOmar Polo
These are not used consistently and some can conflict with system-specific defines. While here, also delete some unused macros.
2022-01-03Update copyright statements to 2022Rémi Verschelde
Happy new year to the wonderful Godot community!
2021-08-30Try other resolved IPs if one fails to connectHaoyu Qiu
2021-07-12[Net] Rename NetworkedMultiplayerPeer to MultiplayerPeer.Fabio Alessandrelli
2021-06-28[Net] Fix WebSocketClient path parsing.Fabio Alessandrelli
Recent changes to parse_url caused the client to make invalid HTTP requests if no path was specified.
2021-06-19Rename `instance()`->`instantiate()` when it's a verbLightning_A
2021-05-06Rename `IP_Unix`, `IP_Address` and `TCP_Server` to remove underscoresHugo Locurcio
2021-02-08Initialize class/struct variables with default values in modules/Rafał Mikrut
2021-01-01Update copyright statements to 2021Rémi Verschelde
Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
2020-11-07Reorganized core/ directory, it was too fatty alreadyreduz
-Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
2020-05-14Style: Enforce braces around if blocks and loopsRémi Verschelde
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
2020-05-12Remove WebSocket defaults from project settings.Fabio Alessandrelli
Can be manually set, let's not pollute them further. Should also be done for WebRTC.
2020-04-02Replace NULL with nullptrlupoDharkael
2020-03-17Style: Set clang-format Standard to Cpp11Rémi Verschelde
For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
2020-01-28Disable Nagle's algorithm for WebSocket TCP.Fabio Alessandrelli
This should greatly decrease latency for the most common use cases. A new function WebSocketPeer::set_no_delay will allow to configure it if so desired.
2020-01-01Update copyright statements to 2020Rémi Verschelde
Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
2019-10-16Trim protocol field from spaces in WS classes.Fabio Alessandrelli
2019-10-09Custom headers support in WebSocketClient.Fabio Alessandrelli
This commit also converts all PoolVector<String> parameters to `const Vector<String>` in both WebSocketServer and WebSocketClient.
2019-10-09WebSocketClient can now use custom SSL certificateFabio Alessandrelli
Via the `trusted_ssl_certificate` property.
2019-10-09Re-implement WebSocket get host/port.Fabio Alessandrelli
Was lost during library switch
2019-08-17Replace last occurrences of 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG'Rémi Verschelde
The last remaining ERR_EXPLAIN call is in FreeType code and makes sense as is (conditionally defines the error message). There are a few ERR_EXPLAINC calls for C-strings where String is not included which can stay as is to avoid adding additional _MSGC macros just for that. Part of #31244.
2019-08-12Replace 'ERR_EXPLAIN' with 'ERR_FAIL_*_MSG' in rest of 'modules/'Robin Hübner
2019-07-28Fix WebSocketClient crash when unref during signalFabio Alessandrelli
Always call disconnect before emitting signals, to avoid calling it on a freed object if the user decides to unreference it in a signal.
2019-07-08Fix WebSocketClient consuming data during hanshakeFabio Alessandrelli
Was missing a break of the while loop on connection. This potentially caused early data frames to be trashed.
2019-07-04Optimize header reads (avoid extra allocs)Fabio Alessandrelli
2019-07-04WebSocket module now uses wslay library.Fabio Alessandrelli
Both client and server are supported on native builds (as usual). SSL server is still not supported, but will soon be possible with this new library. The API stays the same, we just need to work out potential issues due to this big library switch.