Commit Graph

109 Commits

Author SHA1 Message Date
b7f537c863 Fix HTTPRequest timeout being scaled with Engine.time_scale
The server's response time won't change according to the engine's
time scale, so the timeout shouldn't be adjusted accordingly.
2025-11-12 23:55:29 +01:00
ead282ff13 Remove file_access.h and script_backtrace.h includes from logger.h. 2025-10-05 17:49:23 +09:00
9bc59cd100 - fixed wrong "location" substring matching when HTTP status is 301 or 302 2025-07-07 23:12:25 +02:00
42249bb659 Add @export_file_path to export raw paths (no UID) 2025-05-22 13:25:17 +02:00
5113022dfe Clean up some uses of String::substr
Cases where the end position is either equvalent to the default or past
the end of the string.
2025-03-07 14:50:38 +01:00
73d85f46c9 Remove unused headers in scene.
Co-authored-by: Thaddeus Crews <repiteo@outlook.com>

Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>
2024-12-24 00:40:09 +08:00
68f638cf02 Use (r)find_char instead of (r)find for single characters 2024-11-17 10:02:18 +01:00
6516ca6b11 Parse fragment from URL 2024-09-27 19:42:30 +08:00
b4c6cc7d82 [Core] Add case-insensitive String::containsn 2024-05-08 12:48:01 +02:00
815038962f Improve error reporting in the asset library and in related types
This also makes errors related to asset image loading
verbose-only, because, frankly, users can't do much about
those errors. Spamming them with error messages
about some assets on the frontend being broken
is pointless.
2024-01-26 20:33:22 +01:00
bd70b8e1f6 Add THREADS_ENABLED macro in order to compile Godot to run on the main thread 2024-01-17 13:58:29 -05:00
0e8f90f4c8 Update deferred calls to use Callables 2024-01-09 16:11:47 +01:00
4aaa2e6477 Fix wait for thread not started 2023-04-27 20:28:22 +02:00
adba870534 [NET] Refactor TLS configuration.
Use a TLSOptions configuration object which is created via static
functions.

- "TLSOptions.client": uses the standard CA and common name verification.
- "TLSOptions.client_unsafe": uses optional CA verification (i.e. if specified)
- "TLSOptions.server": is the standard server configuration (chain + key)

This will allow us to expand the TLS configuration options to include
e.g. mutual authentication without bloating the classes that uses
StreamPeerTLS and PacketPeerDTLS as underlying peers.
2023-01-28 11:08:02 +01:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
145f07c037 [Net] Fix HTTPRequest gzip with high compression ratio.
Decompress each body chunk over multiple iterations, this causes more
reallocations, but it ensures decompression will not fail no matter the
compression ratio.
2022-11-20 22:41:14 +01:00
172a9e0b24 [HTTPRequest] Cleanup, refactor deferred call. 2022-09-20 18:39:10 +02:00
98047e791a [HTTPRequest] Body streaming decompresison.
Using a StreamPeerGZIP (which acts as a ringbuffer).
2022-09-20 18:39:10 +02:00
a95d792420 [Net] Rename "ssl" references to "tls" in methods and members. 2022-09-08 03:24:23 +02:00
4678736a39 Add suffixes to all nodes and resources 2022-06-11 09:41:05 -05:00
4bf99f4af2 Narrow FileAccess scope to prevent deadlocks. 2022-04-12 10:54:39 +03:00
9381acb6a4 Make FileAccess and DirAccess classes reference counted. 2022-04-11 13:28:51 +03:00
f851c4aa33 Fix some issues found by cppcheck. 2022-04-06 14:34:37 +03:00
4a95408dd4 [Net] Change HTTPRequest timeout type to double.
For consistency with the Timer class and general time representation
inside the engine.
2022-03-27 18:15:56 +02:00
0f5455230c Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
6ff753675a Merge pull request #56771 from mhilbrunner/unacceptable
Verify custom HTTP headers, fix off by one error
2022-02-02 18:28:30 +01:00
fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
3ef5a97505 Verify custom HTTP headers, fix off by one error 2022-01-27 03:22:37 +01:00
3a83872d26 HTTP comment cleanup 2022-01-27 03:22:37 +01:00
17d4d3839e [Net] Fix HTTPRequest memory leak in compressed responses.
When accept_gzip = true.
2022-01-24 14:24:45 +01:00
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
75ed3d74e8 Merge pull request #55747 from timothyqiu/editor-proxy
Add proxy support for the editor
2021-12-16 10:06:14 +01:00
49403cbfa0 Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
5912dd2964 Add proxy support for the editor
* Adds proxy support for `HTTPRequest`.
* Adds `network/http_proxy/{host,port}` editor settings.
    * Labeled as "HTTP Proxy" and it will be used for both HTTP and
      HTTPS requests. This is the same convention as seen in Android
      Studio's proxy settings.
* Makes Asset Library and Export Template Manager use proxy according to
  the editor settings.
2021-12-09 11:48:16 +08:00
5ae569560d Fix missing argument names in bindings
While at it, tweak some boolean setters to use `p_enabled` for the bool.

Also renames `draw_minimap()` to `set_draw_minimap()`.
2021-10-09 00:20:10 +02:00
9dd0d3f550 Don't memcpy to nullptr even if length is zero 2021-09-29 20:58:14 +08:00
eb4902a455 Fix some unnecessary includes 2021-08-13 00:27:38 -05:00
ac3322b0af Use const references where possible for List range iterators 2021-07-25 12:22:25 +02:00
4e6efd1b07 Use C++ iterators for Lists in many situations 2021-07-23 17:38:28 -04:00
6631f66c2a Optimize StringName usage
* Added a new macro SNAME() that constructs and caches a local stringname.
* Subsequent usages use the cached version.
* Since these use a global static variable, a second refcounter of static usages need to be kept for cleanup time.
* Replaced all theme usages by this new macro.
* Replace all signal emission usages by this new macro.
* Replace all call_deferred usages by this new macro.

This is part of ongoing work to optimize GUI and the editor.
2021-07-18 21:20:02 -03:00
b00c4a4360 [Net] Makes HTTPClient a custom instance class. 2021-06-23 14:10:45 +02:00
421e771012 [Net] Unify HTTPClient request and request_raw. 2021-06-23 13:53:43 +02:00
e28fd07b2b Rename instance()->instantiate() when it's a verb 2021-06-19 20:49:18 -06:00
507a9beca1 [Net] Fix HTTPRquest store_buffer error.
HTTPRquest no longer call store_buffer/append_array when the chunk size
is 0.
2021-05-31 15:42:31 +02:00
015fc2ad4f Merge pull request #48205 from Faless/net/4.x_url_parsing
[Net] Implement String::parse_url for parsing URLs.
2021-05-03 13:55:57 +02:00
8247667a3e Core: Drop custom copymem/zeromem defines
We've been using standard C library functions `memcpy`/`memset` for these since
2016 with 67f65f6639.

There was still the possibility for third-party platform ports to override the
definitions with a custom header, but this doesn't seem useful anymore.
2021-04-27 16:26:27 +02:00
3bb40669d5 [Net] Implement String::parse_url for parsing URLs.
Splits the URL into (scheme, host, port, path).
Supports both literal IPv4 and IPv6.
Strip credentials when present (e.g. http://user:pass@example.com/).

Use that function in both HTTPRequest and WebSocketClient.
2021-04-26 09:55:24 +02:00
9bbe51dc27 Style: Apply clang-tidy's modernize-use-nullptr 2021-04-05 14:05:07 +02:00
91181c2086 Fixes small typos and grammar correction 2021-03-12 19:05:16 +05:30
9dd28a2953 Merge pull request #35246 from zaksnet/disconnect-while-downloading
Disconnect while downloading
2021-03-02 12:42:52 +01:00