summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorJohn Huang <jsh@google.com>2013-11-13 19:13:59 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-11-13 19:14:00 +0000
commit54ca906604c2ff0a58274e5d1b66cdba4df8c3d8 (patch)
treeb0471ba448dccf28976ce3fbee6e1c801eca26c6 /services
parent41b92b008e03be95db938e0238ccb9373c2aaadc (diff)
parent4038724a536c990859866489195add7ed537006b (diff)
downloadframeworks_base-54ca906604c2ff0a58274e5d1b66cdba4df8c3d8.zip
frameworks_base-54ca906604c2ff0a58274e5d1b66cdba4df8c3d8.tar.gz
frameworks_base-54ca906604c2ff0a58274e5d1b66cdba4df8c3d8.tar.bz2
Merge "Get rid of a race in NsdService in stopResolveService and getAddrInfo" into klp-dev
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NsdService.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/java/com/android/server/NsdService.java b/services/java/com/android/server/NsdService.java
index e0f415b..16d2468 100644
--- a/services/java/com/android/server/NsdService.java
+++ b/services/java/com/android/server/NsdService.java
@@ -483,10 +483,14 @@ public class NsdService extends INsdManager.Stub {
clientInfo.mResolvedService.setPort(Integer.parseInt(cooked[4]));
stopResolveService(id);
- if (!getAddrInfo(id, cooked[3])) {
+ removeRequestMap(clientId, id, clientInfo);
+
+ int id2 = getUniqueId();
+ if (getAddrInfo(id2, cooked[3])) {
+ storeRequestMap(clientId, id2, clientInfo);
+ } else {
clientInfo.mChannel.sendMessage(NsdManager.RESOLVE_SERVICE_FAILED,
NsdManager.FAILURE_INTERNAL_ERROR, clientId);
- removeRequestMap(clientId, id, clientInfo);
clientInfo.mResolvedService = null;
}
break;