惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
F
Fortinet All Blogs
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
罗磊的独立博客
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
G
Google Developers Blog
H
Help Net Security

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 test: merge chat context notice checks · openclaw/openclaw@5c2f4af feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248
Android: modernize WebView and discovery API usage (#6762...
hxy91819 · 2026-04-16 · via Recent Commits to openclaw:main

@@ -12,6 +12,7 @@ import java.io.IOException

1212

import java.net.InetSocketAddress

1313

import java.nio.ByteBuffer

1414

import java.nio.charset.CodingErrorAction

15+

import java.time.Duration

1516

import java.util.concurrent.ConcurrentHashMap

1617

import java.util.concurrent.Executor

1718

import java.util.concurrent.Executors

@@ -132,38 +133,38 @@ class GatewayDiscovery(

132133

object : NsdManager.ResolveListener {

133134

override fun onResolveFailed(serviceInfo: NsdServiceInfo, errorCode: Int) {}

134135135-

override fun onServiceResolved(resolved: NsdServiceInfo) {

136-

val host = resolved.host?.hostAddress ?: return

137-

val port = resolved.port

138-

if (port <= 0) return

139-140-

val rawServiceName = resolved.serviceName

141-

val serviceName = BonjourEscapes.decode(rawServiceName)

142-

val displayName = BonjourEscapes.decode(txt(resolved, "displayName") ?: serviceName)

143-

val lanHost = txt(resolved, "lanHost")

144-

val tailnetDns = txt(resolved, "tailnetDns")

145-

val gatewayPort = txtInt(resolved, "gatewayPort")

146-

val canvasPort = txtInt(resolved, "canvasPort")

147-

val tlsEnabled = txtBool(resolved, "gatewayTls")

148-

val tlsFingerprint = txt(resolved, "gatewayTlsSha256")

149-

val id = stableId(serviceName, "local.")

150-

localById[id] =

151-

GatewayEndpoint(

152-

stableId = id,

153-

name = displayName,

154-

host = host,

155-

port = port,

156-

lanHost = lanHost,

157-

tailnetDns = tailnetDns,

158-

gatewayPort = gatewayPort,

159-

canvasPort = canvasPort,

160-

tlsEnabled = tlsEnabled,

161-

tlsFingerprintSha256 = tlsFingerprint,

162-

)

163-

publish()

164-

}

165-

},

166-

)

136+

override fun onServiceResolved(resolved: NsdServiceInfo) {

137+

val host = resolved.host?.hostAddress ?: return

138+

val port = resolved.port

139+

if (port <= 0) return

140+141+

val rawServiceName = resolved.serviceName

142+

val serviceName = BonjourEscapes.decode(rawServiceName)

143+

val displayName = BonjourEscapes.decode(txt(resolved, "displayName") ?: serviceName)

144+

val lanHost = txt(resolved, "lanHost")

145+

val tailnetDns = txt(resolved, "tailnetDns")

146+

val gatewayPort = txtInt(resolved, "gatewayPort")

147+

val canvasPort = txtInt(resolved, "canvasPort")

148+

val tlsEnabled = txtBool(resolved, "gatewayTls")

149+

val tlsFingerprint = txt(resolved, "gatewayTlsSha256")

150+

val id = stableId(serviceName, "local.")

151+

localById[id] =

152+

GatewayEndpoint(

153+

stableId = id,

154+

name = displayName,

155+

host = host,

156+

port = port,

157+

lanHost = lanHost,

158+

tailnetDns = tailnetDns,

159+

gatewayPort = gatewayPort,

160+

canvasPort = canvasPort,

161+

tlsEnabled = tlsEnabled,

162+

tlsFingerprintSha256 = tlsFingerprint,

163+

)

164+

publish()

165+

}

166+

},

167+

)

167168

}

168169169170

private fun publish() {

@@ -350,7 +351,7 @@ class GatewayDiscovery(

350351

}

351352352353

private fun records(msg: Message?, section: Int): List<Record> {

353-

return msg?.getSectionArray(section)?.toList() ?: emptyList()

354+

return msg?.getSection(section).orEmpty()

354355

}

355356356357

private fun keyName(raw: String): String {

@@ -426,14 +427,14 @@ class GatewayDiscovery(

426427

try {

427428

SimpleResolver().apply {

428429

setAddress(InetSocketAddress(addr, 53))

429-

setTimeout(3)

430+

setTimeout(Duration.ofSeconds(3))

430431

}

431432

} catch (_: Throwable) {

432433

null

433434

}

434435

}

435436

if (resolvers.isEmpty()) return null

436-

ExtendedResolver(resolvers.toTypedArray()).apply { setTimeout(3) }

437+

ExtendedResolver(resolvers.toTypedArray()).apply { setTimeout(Duration.ofSeconds(3)) }

437438

} catch (_: Throwable) {

438439

null

439440

}