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;

_______________________________________________
help-smalltalk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/help-smalltalk

Reply via email to