summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJose <pepone@users.noreply.github.com>2019-09-10 22:03:44 +0200
committerGitHub <noreply@github.com>2019-09-10 22:03:44 +0200
commitc7b9f79e8bb324dd407eba8503c24f7bba012844 (patch)
tree934b4c0938d6145db919f41bb3851af83ee14444 /js
parentDispose the X509Chain with .NET Standard 2.0 - Close #518 (diff)
downloadice-c7b9f79e8bb324dd407eba8503c24f7bba012844.tar.bz2
ice-c7b9f79e8bb324dd407eba8503c24f7bba012844.tar.xz
ice-c7b9f79e8bb324dd407eba8503c24f7bba012844.zip
Fixes for endpoint to string conversion - Close #517 (#519)
Diffstat (limited to 'js')
-rw-r--r--js/src/Ice/IPEndpointI.js14
-rw-r--r--js/test/Ice/proxy/Client.js3
2 files changed, 15 insertions, 2 deletions
diff --git a/js/src/Ice/IPEndpointI.js b/js/src/Ice/IPEndpointI.js
index 9630847396c..06bf0298325 100644
--- a/js/src/Ice/IPEndpointI.js
+++ b/js/src/Ice/IPEndpointI.js
@@ -24,7 +24,7 @@ class IPEndpointI extends Ice.EndpointI
super();
this._instance = instance;
this._host = ho === undefined ? null : ho;
- this._port = po === undefined ? null : po;
+ this._port = po === undefined ? 0 : po;
this._sourceAddr = sa === undefined ? null : sa;
this._connectionId = conId === undefined ? "" : conId;
}
@@ -132,7 +132,17 @@ class IPEndpointI extends Ice.EndpointI
if(this._sourceAddr !== null && this._sourceAddr.length > 0)
{
- s += " --sourceAddr " + this._sourceAddr;
+ s += " --sourceAddress ";
+ const addQuote = this._sourceAddr.indexOf(':') != -1;
+ if(addQuote)
+ {
+ s += "\"";
+ }
+ s += this._sourceAddr;
+ if(addQuote)
+ {
+ s += "\"";
+ }
}
return s;
}
diff --git a/js/test/Ice/proxy/Client.js b/js/test/Ice/proxy/Client.js
index ea395d33685..128cd058701 100644
--- a/js/test/Ice/proxy/Client.js
+++ b/js/test/Ice/proxy/Client.js
@@ -108,6 +108,9 @@
test(b1.ice_getIdentity().name === "test" && b1.ice_getIdentity().category === "category" &&
b1.ice_getAdapterId().length === 0);
+ b1 = communicator.stringToProxy("test:tcp --sourceAddress \"::1\"");
+ test(b1.equals(communicator.stringToProxy(b1.toString())));
+
b1 = communicator.stringToProxy("");
test(b1 === null);
b1 = communicator.stringToProxy("\"\"");