help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] Swazoo binding on localhost (127.0.0.1)


From: Holger Hans Peter Freyther
Subject: [Help-smalltalk] Swazoo binding on localhost (127.0.0.1)
Date: Thu, 04 Aug 2011 18:25:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.18) 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 '0.0.0.0' but for any other ip address it fails:


Example code

Iliad.ILSite default ip: '127.0.0.1'.
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/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
     ]




While using the Gst Inspector:

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;



reply via email to

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