[Scummvm-git-logs] scummvm master -> f26fd6ca31235468d49869ed3067b0a85d45da69
lephilousophe
noreply at scummvm.org
Thu May 14 14:55:09 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
fa285e48b7 ANDROID: Don't abort when HTTP headers array is null
f26fd6ca31 ANDROID: Fix HTTP client not returning content on error
Commit: fa285e48b7f420487b143096227c10d7000e3a08
https://github.com/scummvm/scummvm/commit/fa285e48b7f420487b143096227c10d7000e3a08
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-05-14T16:54:48+02:00
Commit Message:
ANDROID: Don't abort when HTTP headers array is null
And don't send an empty array of headers.
Fix #16678.
Changed paths:
backends/networking/http/android/networkreadstream-android.cpp
backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
diff --git a/backends/networking/http/android/networkreadstream-android.cpp b/backends/networking/http/android/networkreadstream-android.cpp
index dec0e6549d1..eec8ce12586 100644
--- a/backends/networking/http/android/networkreadstream-android.cpp
+++ b/backends/networking/http/android/networkreadstream-android.cpp
@@ -131,6 +131,9 @@ static jobjectArray getHeaders(JNIEnv *env, RequestHeaders *headersList) {
if (!headersList) {
return nullptr;
}
+ if (headersList->size() == 0) {
+ return nullptr;
+ }
jclass stringClass = env->FindClass("java/lang/String");
jobjectArray array = env->NewObjectArray(headersList->size() * 2, stringClass, nullptr);
diff --git a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
index b83aa874961..0383e81553e 100644
--- a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
+++ b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
@@ -202,6 +202,9 @@ public class HTTPRequest implements Runnable {
}
private void setupHeaders(String[] requestHeaders) {
+ if (requestHeaders == null) {
+ return;
+ }
if ((requestHeaders.length & 1) != 0) {
throw new IllegalArgumentException("requestHeaders has odd length");
}
Commit: f26fd6ca31235468d49869ed3067b0a85d45da69
https://github.com/scummvm/scummvm/commit/f26fd6ca31235468d49869ed3067b0a85d45da69
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-05-14T16:54:48+02:00
Commit Message:
ANDROID: Fix HTTP client not returning content on error
This makes OneDrive work for real.
Changed paths:
backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
diff --git a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
index 0383e81553e..99e66b7f0c5 100644
--- a/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
+++ b/backends/platform/android/org/scummvm/scummvm/net/HTTPRequest.java
@@ -328,7 +328,19 @@ public class HTTPRequest implements Runnable {
int contentLength = urlConnection.getContentLength();
- InputStream in = urlConnection.getInputStream();
+ InputStream in;
+ try {
+ in = urlConnection.getInputStream();
+ } catch (IOException e) {
+ // If getInputStream fails, the server may have returned an error code
+ // We can get the data from the error stream.
+ // If the error stream is null, it means a real error: rethrow the exception.
+ in = urlConnection.getErrorStream();
+ if (in == null) {
+ throw e;
+ }
+ }
+
if (_cancelled.get()) {
cleanup();
return;
@@ -361,7 +373,8 @@ public class HTTPRequest implements Runnable {
final int responseCode = urlConnection.getResponseCode();
_manager.enqueue(() -> finished(_nativePointer, responseCode, null));
} catch (FileNotFoundException e) {
- // The server returned an error, return the error code and no data
+ // The server returned an error, and we didn't managed to get the error stream:
+ // return the error code and no data
int responseCode = -1;
try {
responseCode = urlConnection.getResponseCode();
More information about the Scummvm-git-logs
mailing list