On 08/04/2011 06:25 PM, Holger Hans Peter Freyther wrote: > Hi all, > > I tried to bind Swazoo to the localhost but then it does not respond to > requests anymore. It seems to throw an exception in the > SiteIdentifier>>#ipMatch: for the input we get. There is the special case for > the '0.0.0.0' but for any other ip address it fails:
I would propose these two patches. It feels a bit weird to get from SpIPAddress to string to SpIPAddress.
>From f0e67b102c965dc1ab5e7389e61e3eec7b02054a Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther <[email protected]> Date: Fri, 5 Aug 2011 16:09:08 +0200 Subject: [PATCH 2/3] HTTP: Conver SpIPAddress to String so it can be resolved This fixes putting a site on a specific ip address. 2011-08-05 Holger Freyther <[email protected]> * HTTP.st: Fix response generation for websites available on a specific interface. Convert the SpIPAddress to a string so it can be resolved again without generating a DNU on substrings:. --- packages/swazoo-httpd/ChangeLog | 7 +++++++ packages/swazoo-httpd/HTTP.st | 2 +- 2 files changed, 8 insertions(+), 1 deletions(-) diff --git a/packages/swazoo-httpd/ChangeLog b/packages/swazoo-httpd/ChangeLog index 18f9765..c379098 100644 --- a/packages/swazoo-httpd/ChangeLog +++ b/packages/swazoo-httpd/ChangeLog @@ -1,3 +1,10 @@ +2011-08-05 Holger Freyther <[email protected]> + + * HTTP.st: Fix response generation for websites + available on a specific interface. Convert the + SpIPAddress to a string so it can be resolved + again without generating a DNU on substrings:. + 2011-02-03 Paolo Bonzini <[email protected]> * Extensions.st: Remove diff header. :/ diff --git a/packages/swazoo-httpd/HTTP.st b/packages/swazoo-httpd/HTTP.st index 32c9020..1f9f7b8 100644 --- a/packages/swazoo-httpd/HTTP.st +++ b/packages/swazoo-httpd/HTTP.st @@ -1760,7 +1760,7 @@ URIIdentifier subclass: SiteIdentifier [ ifTrue: [^true]. "is this always good?" myIP := SpIPAddress hostName: self ip port: self port. - otherIP := SpIPAddress hostName: aSiteIdentifier ip + otherIP := SpIPAddress hostName: aSiteIdentifier ip hostAddressString port: aSiteIdentifier port. ^myIP hostAddress = otherIP hostAddress ] -- 1.7.4.1
>From 86544ce7d40f57d5a6b96f792e9cd7246bd4192e Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther <[email protected]> Date: Fri, 5 Aug 2011 16:11:37 +0200 Subject: [PATCH 3/3] HTTPRequest>>#printOn: Use nextPutAll for strings 2011-08-05 Holger Freyther <[email protected]> * Messages.st: Fix HTTPRequest>>#printOn:. by using nextPutAll: for Strings. --- packages/swazoo-httpd/ChangeLog | 5 +++++ packages/swazoo-httpd/Messages.st | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/swazoo-httpd/ChangeLog b/packages/swazoo-httpd/ChangeLog index c379098..93d58d4 100644 --- a/packages/swazoo-httpd/ChangeLog +++ b/packages/swazoo-httpd/ChangeLog @@ -1,5 +1,10 @@ 2011-08-05 Holger Freyther <[email protected]> + * Messages.st: Fix HTTPRequest>>#printOn:. + by using nextPutAll: for Strings. + +2011-08-05 Holger Freyther <[email protected]> + * HTTP.st: Fix response generation for websites available on a specific interface. Convert the SpIPAddress to a string so it can be resolved diff --git a/packages/swazoo-httpd/Messages.st b/packages/swazoo-httpd/Messages.st index 0a0660a..49250fa 100644 --- a/packages/swazoo-httpd/Messages.st +++ b/packages/swazoo-httpd/Messages.st @@ -407,14 +407,14 @@ HTTPMessage subclass: HTTPRequest [ printOn: aStream [ <category: 'private'> aStream nextPutAll: 'a HTTPRequest ' , self methodName. - self isHttp10 ifTrue: [aStream nextPut: ' HTTP/1.0']. + self isHttp10 ifTrue: [aStream nextPutAll: ' HTTP/1.0']. self peer notNil ifTrue: [aStream cr; tab; nextPutAll: ' from: '; - nextPutAll: self peer]. + nextPutAll: self peer hostAddressString]. aStream cr; tab; -- 1.7.4.1
_______________________________________________ help-smalltalk mailing list [email protected] https://lists.gnu.org/mailman/listinfo/help-smalltalk
