summaryrefslogtreecommitdiff
path: root/js/src/Ice/EndpointFactoryManager.js
diff options
context:
space:
mode:
authorBenoit Foucher <benoit@zeroc.com>2017-04-27 13:05:25 +0200
committerBenoit Foucher <benoit@zeroc.com>2017-04-27 13:05:25 +0200
commitc5ee6fd5310199110dae6b2d01decbd20174d8db (patch)
treedaf558482821eb3a1ffd496b06ba8bcc2edce841 /js/src/Ice/EndpointFactoryManager.js
parentExtra whitespace (diff)
downloadice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.bz2
ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.tar.xz
ice-c5ee6fd5310199110dae6b2d01decbd20174d8db.zip
Fixed ICE-6680 - WS transports are now provided by a separate IceWS plugin
Diffstat (limited to 'js/src/Ice/EndpointFactoryManager.js')
-rw-r--r--js/src/Ice/EndpointFactoryManager.js28
1 files changed, 17 insertions, 11 deletions
diff --git a/js/src/Ice/EndpointFactoryManager.js b/js/src/Ice/EndpointFactoryManager.js
index 04e1f6c8f75..5a3db1da8c2 100644
--- a/js/src/Ice/EndpointFactoryManager.js
+++ b/js/src/Ice/EndpointFactoryManager.js
@@ -126,19 +126,25 @@ class EndpointFactoryManager
read(s)
{
const type = s.readShort();
- for(let i = 0; i < this._factories.length; ++i)
+
+ const factory = this.get(type);
+ let e = null;
+ s.startEncapsulation();
+ if(factory)
{
- if(this._factories[i].type() == type)
- {
- s.startEncapsulation();
- const e = this._factories[i].read(s);
- s.endEncapsulation();
- return e;
- }
+ e = factory.read(s);
+ }
+ //
+ // If the factory failed to read the endpoint, return an opaque endpoint. This can
+ // occur if for example the factory delegates to another factory and this factory
+ // isn't available. In this case, the factory needs to make sure the stream position
+ // is preserved for reading the opaque endpoint.
+ //
+ if(!e)
+ {
+ e = new OpaqueEndpointI(type);
+ e.initWithStream(s);
}
- s.startEncapsulation();
- const e = new OpaqueEndpointI(type);
- e.initWithStream(s);
s.endEncapsulation();
return e;
}