From 3b4b5c36b6b5aff72d22101d328b7ac2a7dfc501 Mon Sep 17 00:00:00 2001 From: Alex Wenckus Date: Tue, 28 Feb 2006 18:52:17 +0000 Subject: [PATCH] Disco was not responding correctly when the provided node was not found. SMACK-126 git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@3502 b35dd754-fafc-0310-a699-88a17e54d16e --- .../org/jivesoftware/smackx/ServiceDiscoveryManager.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java index 7cdbd0510..94b2ea4cf 100644 --- a/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java +++ b/source/org/jivesoftware/smackx/ServiceDiscoveryManager.java @@ -167,6 +167,12 @@ public class ServiceDiscoveryManager { while (items.hasNext()) { response.addItem((DiscoverItems.Item) items.next()); } + } else if(discoverItems.getNode() != null) { + // Return an error since the client + // doesn't contain the specified node + response.setNode(discoverItems.getNode()); + response.setType(IQ.Type.ERROR); + response.setError(new XMPPError(404, "item-not-found")); } connection.sendPacket(response); } @@ -202,6 +208,7 @@ public class ServiceDiscoveryManager { } else { // Return an error since a client doesn't have nodes + response.setNode(discoverInfo.getNode()); response.setType(IQ.Type.ERROR); response.setError(new XMPPError(404, "item-not-found")); }