[PATCH 1 of 1] zeroconf: don't fail on non-local names

Matt Mackall mpm at selenic.com
Wed Apr 15 16:14:16 CDT 2009


On Mon, 2009-04-13 at 21:59 +0300, Alexander Solovyov wrote:
> # HG changeset patch
> # User Alexander Solovyov <piranha at piranha.org.ua>
> # Date 1239647032 -10800
> # Node ID 84c3941152811f4ea90b1f0f127c22f1e1fa7280
> # Parent  fe2a87a3d344878982641110dd26f2949a0b6fff
> zeroconf: don't fail on non-local names
> 
> diff --git a/hgext/zeroconf/Zeroconf.py b/hgext/zeroconf/Zeroconf.py
> --- a/hgext/zeroconf/Zeroconf.py
> +++ b/hgext/zeroconf/Zeroconf.py
> @@ -259,7 +259,7 @@ class DNSQuestion(DNSEntry):
>  
>  	def __init__(self, name, type, clazz):
>  		if not name.endswith(".local."):
> -			raise NonLocalNameException
> +			raise NonLocalNameException(name)
>  		DNSEntry.__init__(self, name, type, clazz)
>  
>  	def answeredBy(self, rec):
> @@ -492,8 +492,11 @@ class DNSIncoming(object):
>  			info = struct.unpack(format, self.data[self.offset:self.offset+length])
>  			self.offset += length
>  
> -			question = DNSQuestion(name, info[0], info[1])
> -			self.questions.append(question)
> +			try:
> +				question = DNSQuestion(name, info[0], info[1])
> +				self.questions.append(question)
> +			except NonLocalNameException:
> +				pass
>  
>  	def readInt(self):
>  		"""Reads an integer from the packet"""
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel

Queued. Next time, no 0 of 1 please.

-- 
http://selenic.com : development and support for Mercurial and Linux




More information about the Mercurial-devel mailing list