Skip to content

Commit 9e13eee

Browse files
committed
Additional maplibre patches
1 parent 70fdfb1 commit 9e13eee

File tree

3 files changed

+108
-0
lines changed

3 files changed

+108
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
diff --git a/include/mbgl/gfx/shader_registry.hpp b/include/mbgl/gfx/shader_registry.hpp
2+
index ec3716ceb..816009c5d 100644
3+
--- a/include/mbgl/gfx/shader_registry.hpp
4+
+++ b/include/mbgl/gfx/shader_registry.hpp
5+
@@ -5,6 +5,7 @@
6+
#include <memory>
7+
#include <mutex>
8+
#include <shared_mutex>
9+
+#include <string>
10+
#include <unordered_map>
11+
12+
namespace mbgl {
13+
diff --git a/include/mbgl/storage/resource_options.hpp b/include/mbgl/storage/resource_options.hpp
14+
index bb5619c70..0afe44e0b 100644
15+
--- a/include/mbgl/storage/resource_options.hpp
16+
+++ b/include/mbgl/storage/resource_options.hpp
17+
@@ -2,6 +2,7 @@
18+
19+
#include <memory>
20+
#include <string>
21+
+#include <cstdint>
22+
#include <mbgl/util/tile_server_options.hpp>
23+
24+
namespace mbgl {
25+
diff --git a/src/mbgl/text/bidi.hpp b/src/mbgl/text/bidi.hpp
26+
index 1f03ab91d..b24d48531 100644
27+
--- a/src/mbgl/text/bidi.hpp
28+
+++ b/src/mbgl/text/bidi.hpp
29+
@@ -4,6 +4,7 @@
30+
#include <string>
31+
#include <vector>
32+
#include <memory>
33+
+#include <cstdint>
34+
35+
#include <mbgl/util/noncopyable.hpp>
36+
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
From f2eec1201ecd8922535717e3db33e2ffc2bebc13 Mon Sep 17 00:00:00 2001
2+
From: Dirk Vanden Boer <dirk.vdb@gmail.com>
3+
Date: Sun, 5 Oct 2025 13:56:39 +0200
4+
Subject: [PATCH] Qt6 causes HTTP/2 errors
5+
6+
https://github.com/maplibre/maplibre-native/issues/3644
7+
---
8+
platform/qt/src/mbgl/http_file_source.cpp | 35 ++++++++++++++++++-----
9+
1 file changed, 28 insertions(+), 7 deletions(-)
10+
11+
diff --git a/platform/qt/src/mbgl/http_file_source.cpp b/platform/qt/src/mbgl/http_file_source.cpp
12+
index 43df2470715f..dd3bff2c1fdc 100644
13+
--- a/platform/qt/src/mbgl/http_file_source.cpp
14+
+++ b/platform/qt/src/mbgl/http_file_source.cpp
15+
@@ -68,12 +68,21 @@ void HTTPFileSource::Impl::cancel(HTTPRequest* req) {
16+
17+
if (requestsVector.empty()) {
18+
m_pending.erase(it);
19+
+#if QT_VERSION >= QT_VERSION_CHECK(5, 9, 4)
20+
+ // Qt 5.9.4 introduced HTTP/2, in the ideal world we would like to know if this reply
21+
+ // is from a HTTP/2 connection. At this point in time we cannot check it. If HTTP/2 is
22+
+ // in use we may not abort the connection.
23+
+ Q_UNUSED(reply);
24+
+#else
25+
+ // Works fine with HTTP/1
26+
if (reply) reply->abort();
27+
+#endif
28+
}
29+
}
30+
31+
void HTTPFileSource::Impl::onReplyFinished() {
32+
QNetworkReply* reply = qobject_cast<QNetworkReply*>(sender());
33+
+ if (!reply) return;
34+
const QUrl& url = reply->request().url();
35+
36+
auto it = m_pending.find(url);
37+
@@ -82,14 +91,26 @@ void HTTPFileSource::Impl::onReplyFinished() {
38+
return;
39+
}
40+
41+
- QByteArray data = reply->readAll();
42+
- QVector<HTTPRequest*>& requestsVector = it.value().second;
43+
+ // Error handling
44+
+ if (reply->error() != QNetworkReply::NoError) {
45+
+ qWarning() << "Network error for URL" << url << ":" << reply->errorString();
46+
+
47+
+ QVariant statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
48+
+ if (!statusCode.isValid()) {
49+
+ qWarning() << "No HTTP status code received; possible connection/protocol failure.";
50+
+ }
51+
+
52+
+ m_manager->clearConnectionCache();
53+
+ } else {
54+
+ QByteArray data = reply->readAll();
55+
+ QVector<HTTPRequest*>& requestsVector = it.value().second;
56+
57+
- // Cannot use the iterator to walk the requestsVector
58+
- // because calling handleNetworkReply() might get
59+
- // requests added to the requestsVector.
60+
- while (!requestsVector.isEmpty()) {
61+
- requestsVector.takeFirst()->handleNetworkReply(reply, data);
62+
+ // Cannot use the iterator to walk the requestsVector
63+
+ // because calling handleNetworkReply() might get
64+
+ // requests added to the requestsVector.
65+
+ while (!requestsVector.isEmpty()) {
66+
+ requestsVector.takeFirst()->handleNetworkReply(reply, data);
67+
+ }
68+
}
69+
70+
m_pending.erase(it);

vcpkg_overlay/ports/maplibregl-native/portfile.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ vcpkg_apply_patches(
5050
cmake-changes.patch
5151
timer-overflow.patch
5252
boost-numeric.patch
53+
fix-includes.patch
54+
http2.patch
5355
)
5456

5557
if(VCPKG_TARGET_IS_OSX)

0 commit comments

Comments
 (0)