summaryrefslogtreecommitdiff
path: root/swift/src
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-04-15 22:19:27 +0200
committerJose <jose@zeroc.com>2019-04-15 22:19:57 +0200
commitd131b3a9bbff0cbbfac65d34d7aaf9db4a9140d0 (patch)
treee8995de3605c0bb8b0f9217d3af0145f0d1e0cf1 /swift/src
parentRemoved throws from some Communicator methods (diff)
downloadice-d131b3a9bbff0cbbfac65d34d7aaf9db4a9140d0.tar.bz2
ice-d131b3a9bbff0cbbfac65d34d7aaf9db4a9140d0.tar.xz
ice-d131b3a9bbff0cbbfac65d34d7aaf9db4a9140d0.zip
Fix encodingVersion of wrapped InputStream
Diffstat (limited to 'swift/src')
-rw-r--r--swift/src/Ice/AdminFacetFactory.swift3
-rw-r--r--swift/src/Ice/InputStream.swift4
-rw-r--r--swift/src/Ice/ObjectAdapterI.swift5
-rw-r--r--swift/src/Ice/Proxy.swift13
4 files changed, 16 insertions, 9 deletions
diff --git a/swift/src/Ice/AdminFacetFactory.swift b/swift/src/Ice/AdminFacetFactory.swift
index 2ea7435a2e4..9722280bb14 100644
--- a/swift/src/Ice/AdminFacetFactory.swift
+++ b/swift/src/Ice/AdminFacetFactory.swift
@@ -41,7 +41,8 @@ class AdminFacetFacade: ICEBlobjectFacade {
requestId: requestId,
encoding: EncodingVersion(major: encodingMajor, minor: encodingMinor))
- let incoming = Incoming(istr: InputStream(communicator: communicator, inputStream: `is`),
+ let incoming = Incoming(istr: InputStream(communicator: communicator, inputStream: `is`,
+ encoding: EncodingVersion(major: encodingMajor, minor: encodingMinor)),
response: response,
exception: exception,
current: current)
diff --git a/swift/src/Ice/InputStream.swift b/swift/src/Ice/InputStream.swift
index 3839b6610c3..bee15a1c04b 100644
--- a/swift/src/Ice/InputStream.swift
+++ b/swift/src/Ice/InputStream.swift
@@ -43,9 +43,9 @@ public class InputStream {
traceSlicing = communicator.getProperties().getPropertyAsIntWithDefault(key: "Ice.Trace.Slicing", value: 0) > 0
}
- init(communicator: Communicator, inputStream handle: ICEInputStream) {
+ init(communicator: Communicator, inputStream handle: ICEInputStream, encoding: EncodingVersion) {
self.communicator = communicator
- encoding = currentEncoding // TODO: should we get encoding from ICEInputStream?
+ self.encoding = encoding
self.handle = handle
buf = Buffer(start: handle.data(), count: handle.size())
traceSlicing = communicator.getProperties().getPropertyAsIntWithDefault(key: "Ice.Trace.Slicing", value: 0) > 0
diff --git a/swift/src/Ice/ObjectAdapterI.swift b/swift/src/Ice/ObjectAdapterI.swift
index 342800be4c0..00e8d1c015e 100644
--- a/swift/src/Ice/ObjectAdapterI.swift
+++ b/swift/src/Ice/ObjectAdapterI.swift
@@ -222,7 +222,10 @@ class ObjectAdapterI: LocalObject<ICEObjectAdapter>, ObjectAdapter, ICEBlobjectF
requestId: requestId,
encoding: EncodingVersion(major: encodingMajor, minor: encodingMinor))
- let incoming = Incoming(istr: InputStream(communicator: communicator, inputStream: istr),
+ let incoming = Incoming(istr: InputStream(communicator: communicator,
+ inputStream: istr,
+ encoding: EncodingVersion(major: encodingMajor,
+ minor: encodingMinor)),
response: response,
exception: exception,
current: current)
diff --git a/swift/src/Ice/Proxy.swift b/swift/src/Ice/Proxy.swift
index 0db49c0445c..47e3fe2ba88 100644
--- a/swift/src/Ice/Proxy.swift
+++ b/swift/src/Ice/Proxy.swift
@@ -188,7 +188,8 @@ public extension ObjectPrx {
inParams: $0.baseAddress,
inSize: inEncaps.count,
context: context,
- returnValue: &ok))
+ returnValue: &ok),
+ encoding: _impl._encoding)
return _impl._isTwoway ? (ok, try ins.readEncapsulation().bytes) : (ok, [UInt8]())
}
}
@@ -662,7 +663,7 @@ open class _ObjectPrxI: ObjectPrx {
returnValue: &ok)
if _isTwoway {
- let istr = InputStream(communicator: _communicator, inputStream: istrHandle)
+ let istr = InputStream(communicator: _communicator, inputStream: istrHandle, encoding: self._encoding)
if ok == false {
try _throwUserException(istr: istr, userException: userException)
}
@@ -694,7 +695,7 @@ open class _ObjectPrxI: ObjectPrx {
inSize: ostr.getCount(),
context: context,
returnValue: &ok)
- let istr = InputStream(communicator: _communicator, inputStream: istrHandle)
+ let istr = InputStream(communicator: _communicator, inputStream: istrHandle, encoding: self._encoding)
if ok == false {
try _throwUserException(istr: istr, userException: userException)
}
@@ -732,7 +733,8 @@ open class _ObjectPrxI: ObjectPrx {
do {
if self._isTwoway {
let istr = InputStream(communicator: self._communicator,
- inputStream: inputStream)
+ inputStream: inputStream,
+ encoding: self._encoding)
if ok == false {
try self._throwUserException(istr: istr,
userException: userException)
@@ -779,7 +781,8 @@ open class _ObjectPrxI: ObjectPrx {
response: { ok, inputStream in
do {
let istr = InputStream(communicator: self._communicator,
- inputStream: inputStream)
+ inputStream: inputStream,
+ encoding: self._encoding)
if ok == false {
try self._throwUserException(istr: istr, userException: userException)
}