Skip to content

Commit 1ac31f2

Browse files
authored
Merge branch 'main' into update_codeql_v4
2 parents 77d8da9 + 2fa9ee6 commit 1ac31f2

File tree

2 files changed

+46
-44
lines changed

2 files changed

+46
-44
lines changed

lib/include/public/Version.hpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
#define MAT_VERSION_HPP
77
// WARNING: DO NOT MODIFY THIS FILE!
88
// This file has been automatically generated, manual changes will be lost.
9-
#define BUILD_VERSION_STR "3.9.324.1"
10-
#define BUILD_VERSION 3,9,324,1
9+
#define BUILD_VERSION_STR "3.10.5.1"
10+
#define BUILD_VERSION 3,10,5,1
1111

1212
#ifndef RESOURCE_COMPILER_INVOKED
1313
#include "ctmacros.hpp"
@@ -17,8 +17,8 @@ namespace MAT_NS_BEGIN {
1717

1818
uint64_t const Version =
1919
((uint64_t)3 << 48) |
20-
((uint64_t)9 << 32) |
21-
((uint64_t)324 << 16) |
20+
((uint64_t)10 << 32) |
21+
((uint64_t)5 << 16) |
2222
((uint64_t)1);
2323

2424
} MAT_NS_END
@@ -27,4 +27,3 @@ namespace PAL_NS_BEGIN { } PAL_NS_END
2727

2828
#endif // RESOURCE_COMPILER_INVOKED
2929
#endif
30-

lib/pal/posix/NetworkInformationImpl.mm

Lines changed: 42 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -103,37 +103,6 @@ virtual NetworkCost GetNetworkCost()
103103

104104
void NetworkInformation::SetupNetDetect()
105105
{
106-
auto weak_this = std::weak_ptr<NetworkInformation>(shared_from_this());
107-
108-
m_reach = [ODWReachability reachabilityForInternetConnection];
109-
void (^block)(NSNotification*) = ^(NSNotification*)
110-
{
111-
auto strong_this = weak_this.lock();
112-
if (!strong_this)
113-
{
114-
return;
115-
}
116-
117-
// NetworkCost information is not available until iOS 12.
118-
// Just make the best guess here.
119-
switch (m_reach.currentReachabilityStatus)
120-
{
121-
case NotReachable:
122-
strong_this->UpdateType(NetworkType_Unknown);
123-
strong_this->UpdateCost(NetworkCost_Unknown);
124-
break;
125-
case ReachableViaWiFi:
126-
strong_this->UpdateType(NetworkType_Wifi);
127-
strong_this->UpdateCost(NetworkCost_Unmetered);
128-
break;
129-
case ReachableViaWWAN:
130-
strong_this->UpdateType(NetworkType_WWAN);
131-
strong_this->UpdateCost(NetworkCost_Metered);
132-
break;
133-
}
134-
};
135-
block(nil); // Update the initial status.
136-
137106
if (@available(macOS 10.14, iOS 12.0, *))
138107
{
139108
m_monitor = nw_path_monitor_create();
@@ -186,15 +155,49 @@ virtual NetworkCost GetNetworkCost()
186155
nw_path_monitor_cancel(m_monitor);
187156
}
188157
}
189-
else if (m_isNetDetectEnabled)
158+
else
190159
{
191-
m_notificationId =
192-
[[NSNotificationCenter defaultCenter]
193-
addObserverForName: kNetworkReachabilityChangedNotification
194-
object: nil
195-
queue: nil
196-
usingBlock: block];
197-
[m_reach startNotifier];
160+
auto weak_this = std::weak_ptr<NetworkInformation>(shared_from_this());
161+
162+
m_reach = [ODWReachability reachabilityForInternetConnection];
163+
void (^block)(NSNotification*) = ^(NSNotification*)
164+
{
165+
auto strong_this = weak_this.lock();
166+
if (!strong_this)
167+
{
168+
return;
169+
}
170+
171+
// NetworkCost information is not available until iOS 12.
172+
// Just make the best guess here.
173+
switch (m_reach.currentReachabilityStatus)
174+
{
175+
case NotReachable:
176+
strong_this->UpdateType(NetworkType_Unknown);
177+
strong_this->UpdateCost(NetworkCost_Unknown);
178+
break;
179+
case ReachableViaWiFi:
180+
strong_this->UpdateType(NetworkType_Wifi);
181+
strong_this->UpdateCost(NetworkCost_Unmetered);
182+
break;
183+
case ReachableViaWWAN:
184+
strong_this->UpdateType(NetworkType_WWAN);
185+
strong_this->UpdateCost(NetworkCost_Metered);
186+
break;
187+
}
188+
};
189+
block(nil); // Update the initial status.
190+
191+
if (m_isNetDetectEnabled)
192+
{
193+
m_notificationId =
194+
[[NSNotificationCenter defaultCenter]
195+
addObserverForName: kNetworkReachabilityChangedNotification
196+
object: nil
197+
queue: nil
198+
usingBlock: block];
199+
[m_reach startNotifier];
200+
}
198201
}
199202
}
200203

0 commit comments

Comments
 (0)