From 7c499d47af275d3596fc84aaf37391f99174e97b Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Mon, 18 Feb 2019 22:32:06 -0300 Subject: [PATCH] Working on windows IPC module. --- src/lib3270++/windows/session.cc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/lib3270++/windows/session.cc b/src/lib3270++/windows/session.cc index 58470d2..fd2d934 100644 --- a/src/lib3270++/windows/session.cc +++ b/src/lib3270++/windows/session.cc @@ -92,7 +92,7 @@ IPC::Request & IPC::Request::call() { #ifdef DEBUG - lib3270_trace_data(NULL,"Request block",(const char *) this->out.block, this->out.used); + // lib3270_trace_data(NULL,"Request block",(const char *) this->out.block, this->out.used); #endif // DEBUG in.current = 0; @@ -111,10 +111,24 @@ } + debug("Received response \"", in.block, "\" with ", in.used, " bytes"); #ifdef DEBUG - lib3270_trace_data(NULL,"Response block",(const char *) this->in.block, this->in.used); + // lib3270_trace_data(NULL,"Response block",(const char *) this->in.block, this->in.used); #endif // DEBUG + // Extract response name + in.current = strlen((const char *) in.block)+1; + + // Extract return code + uint16_t rc = *((uint16_t *) (in.block + in.current)); + in.current += sizeof(uint16_t); + + // Extract argc + uint16_t argc = *((uint16_t *) (in.block + in.current)); + in.current += sizeof(uint16_t); + + debug("Received response \"", ((const char *) in.block), "\" with rc=", rc, " and ", argc, " arguments"); + return *this; } -- libgit2 0.21.2