summaryrefslogtreecommitdiffstats
path: root/services/java/com/android
diff options
context:
space:
mode:
authorJohn Huang <jsh@google.com>2013-11-13 12:14:16 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-11-13 12:14:16 -0800
commitc4f535bddac2491aa0e354a609fcbf7c49276295 (patch)
treea734b89a074fc6741e70793518629ab04f0f150f /services/java/com/android
parent955b575dd94370f618f6b6424d60c1aa9dc34c14 (diff)
parent299e011ebd7ce9593c203ecfc9f5eed45360a5ed (diff)
downloadframeworks_base-c4f535bddac2491aa0e354a609fcbf7c49276295.zip
frameworks_base-c4f535bddac2491aa0e354a609fcbf7c49276295.tar.gz
frameworks_base-c4f535bddac2491aa0e354a609fcbf7c49276295.tar.bz2
am 299e011e: am 54ca9066: Merge "Get rid of a race in NsdService in stopResolveService and getAddrInfo" into klp-dev
* commit '299e011ebd7ce9593c203ecfc9f5eed45360a5ed': Get rid of a race in NsdService in stopResolveService and getAddrInfo
Diffstat (limited to 'services/java/com/android')
-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;