[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-smalltalk] Swazoo binding on localhost (

From: Holger Hans Peter Freyther
Subject: [Help-smalltalk] Swazoo binding on localhost (
Date: Thu, 04 Aug 2011 18:25:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv: Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11

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 '' but for any other ip address it fails:

Example code

Iliad.ILSite default ip: ''.
Iliad.SwazooIliad startOn: 8080.

Fix/Hack: Convert the SpIPAddress to a host string so it can be parsed by
SpIPAddress hostName:, alternatively the question is why we want to take the
port from the 'CONTENT' of the HTTP request and not where the connection is
from? e.g. otherIP = aSiteIdentifier ip?

diff --git a/packages/swazoo-httpd/ b/packages/swazoo-httpd/
index 32c9020..1f9f7b8 100644
--- a/packages/swazoo-httpd/
+++ b/packages/swazoo-httpd/
@@ -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

While using the Gst Inspector:

diff --git a/packages/swazoo-httpd/ 
index 0a0660a..49250fa 100644
--- a/packages/swazoo-httpd/
+++ b/packages/swazoo-httpd/
@@ -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
                    nextPutAll: ' from: ';
-                   nextPutAll: self peer].
+                   nextPutAll: self peer hostAddressString].

reply via email to

[Prev in Thread] Current Thread [Next in Thread]