diff options
Diffstat (limited to 'platform')
-rw-r--r-- | platform/javascript/http_client_javascript.cpp | 39 | ||||
-rw-r--r-- | platform/windows/context_gl_win.cpp | 2 | ||||
-rw-r--r-- | platform/x11/detect.py | 3 |
3 files changed, 23 insertions, 21 deletions
diff --git a/platform/javascript/http_client_javascript.cpp b/platform/javascript/http_client_javascript.cpp index 0b105dcb40..b170ba6f35 100644 --- a/platform/javascript/http_client_javascript.cpp +++ b/platform/javascript/http_client_javascript.cpp @@ -37,16 +37,31 @@ Error HTTPClient::connect_to_host(const String &p_host, int p_port, bool p_ssl, WARN_PRINT("Disabling HTTPClient's host verification is not supported for the HTML5 platform, host will be verified"); } + port = p_port; + use_tls = p_ssl; + host = p_host; - if (host.begins_with("http://")) { - host.replace_first("http://", ""); - } else if (host.begins_with("https://")) { - host.replace_first("https://", ""); + + String host_lower = host.to_lower(); + if (host_lower.begins_with("http://")) { + host = host.substr(7, host.length() - 7); + } else if (host_lower.begins_with("https://")) { + use_tls = true; + host = host.substr(8, host.length() - 8); + } + + ERR_FAIL_COND_V(host.length() < HOST_MIN_LEN, ERR_INVALID_PARAMETER); + + if (port < 0) { + if (use_tls) { + port = PORT_HTTPS; + } else { + port = PORT_HTTP; + } } status = host.is_valid_ip_address() ? STATUS_CONNECTING : STATUS_RESOLVING; - port = p_port; - use_tls = p_ssl; + return OK; } @@ -68,17 +83,7 @@ Error HTTPClient::prepare_request(Method p_method, const String &p_url, const Ve ERR_FAIL_COND_V(status != STATUS_CONNECTED, ERR_INVALID_PARAMETER); ERR_FAIL_COND_V(host.empty(), ERR_UNCONFIGURED); ERR_FAIL_COND_V(port < 0, ERR_UNCONFIGURED); - - static const char *_methods[HTTPClient::METHOD_MAX] = { - "GET", - "HEAD", - "POST", - "PUT", - "DELETE", - "OPTIONS", - "TRACE", - "CONNECT" - }; + ERR_FAIL_COND_V(!p_url.begins_with("/"), ERR_INVALID_PARAMETER); String url = (use_tls ? "https://" : "http://") + host + ":" + itos(port) + "/" + p_url; godot_xhr_reset(xhr_id); diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp index 81aa18dd23..ccb0a41d13 100644 --- a/platform/windows/context_gl_win.cpp +++ b/platform/windows/context_gl_win.cpp @@ -181,8 +181,6 @@ Error ContextGL_Win::initialize() { MessageBox(NULL, "Can't Activate The GL 3.3 Rendering Context.", "ERROR", MB_OK | MB_ICONEXCLAMATION); return ERR_CANT_CREATE; // Return FALSE } - - printf("Activated GL 3.3 context"); } wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)wglGetProcAddress("wglSwapIntervalEXT"); diff --git a/platform/x11/detect.py b/platform/x11/detect.py index ed75e5eab5..09bf57c5f1 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -267,8 +267,7 @@ def configure(env): if env["openmp"]: env.Append(CPPFLAGS=['-fopenmp']) - if not env['use_llvm']: - env.Append(LIBS=['gomp']) + env.Append(LINKFLAGS=['-fopenmp']) if env['use_static_cpp']: env.Append(LINKFLAGS=['-static-libstdc++']) |