SRV ClientContext pClient data ctx if pClient RPC RPCContext rpc_ctx s

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
SRV::ClientContext * pClient = data -> ctx;
if ( pClient )
{
RPC::RPCContext * rpc_ctx = static_cast< RPC::RPCContext * >( pClient -> pUserData );
if ( rpc_ctx )
{
LOG->Message( OUT_TEXT, "HandleWrite: Read: %d (%d) %s", sUpstreamContext.iSocket,
pClient -> iSocket, answer.c_str() );
if (rpc_ctx->GetBuffer().data())
{
LOG->Message( OUT_TEXT, "HandleWrite: %s",
rpc_ctx->GetBuffer().data());
}
//rpc_ctx -> GetBuffer().clear();
rpc_ctx -> GetBuffer().accumulate( answer.c_str(), answer.size() );
//LOG->Message( OUT_MESSAGE, "HandleWrite: %s",
// rpc_ctx->GetBuffer().data());
rpc_ctx -> ClearHaveTasks();
rpc_ctx -> SetWriteReady();
//TODO It's my fantasy :-)
//return C_UPSTREAM_REQUEST_OK;
}
delete data;
sUpstreamContext.pUserData = 0;
}