Skip to content

Commit 180f150

Browse files
author
Bret Ambrose
committed
Fixes
1 parent 8079f33 commit 180f150

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

eventstream_rpc/source/EventStreamClient.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,13 @@ namespace Aws
456456
}
457457

458458
void SetAction(ConnectionCallbackActionType action) { m_action = action; }
459-
void SetError(RpcError error) { m_error = error; }
459+
void SetError(RpcError error)
460+
{
461+
if (m_error.baseStatus == EVENT_STREAM_RPC_SUCCESS)
462+
{
463+
m_error = error;
464+
}
465+
}
460466

461467
std::future<RpcError> GetConnectPromiseFuture() { return m_connectPromise.get_future(); }
462468

@@ -873,6 +879,9 @@ namespace Aws
873879
{
874880
std::lock_guard<std::mutex> lock(impl->m_sharedStateLock);
875881
AWS_FATAL_ASSERT(impl->m_sharedState.m_currentState == ClientState::PendingConnect);
882+
883+
// the channel owns the initial ref; we have to take our own
884+
aws_event_stream_rpc_client_connection_acquire(connection);
876885
impl->m_sharedState.m_underlyingConnection = connection;
877886
if (impl->m_sharedState.m_desiredState != ClientState::Connected)
878887
{

0 commit comments

Comments
 (0)