From fde44a5de44fb4762b521bff539133c92e999deb Mon Sep 17 00:00:00 2001 From: Dmitry Simonenko Date: Fri, 17 Feb 2017 12:36:06 +0300 Subject: [PATCH] odissey: add copy support for transaction pooling --- core/CMakeLists.txt | 1 + core/od_router_session.c | 2 ++ core/od_router_transaction.c | 20 ++++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 52db20e3..bc80cf21 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -17,6 +17,7 @@ set(od_src od_router.c od_router_session.c od_router_transaction.c + od_router_copy.c od_cancel.c od_auth.c od_periodic.c diff --git a/core/od_router_session.c b/core/od_router_session.c index 4b19613d..a1bb3108 100644 --- a/core/od_router_session.c +++ b/core/od_router_session.c @@ -135,11 +135,13 @@ od_router_session(od_client_t *client) copy_rc = od_router_copy_in(client); if (copy_rc != OD_RS_OK) return copy_rc; + continue; } /* CopyOutResponse */ if (type == 'H') { assert(! server->is_copy); server->is_copy = 1; + continue; } /* copy out complete */ if (type == 'c') { diff --git a/core/od_router_transaction.c b/core/od_router_transaction.c index ca306ec3..c06de23f 100644 --- a/core/od_router_transaction.c +++ b/core/od_router_transaction.c @@ -36,6 +36,7 @@ #include "od_router.h" #include "od_router_session.h" #include "od_router_transaction.h" +#include "od_router_copy.h" #include "od_cancel.h" #include "od_fe.h" #include "od_be.h" @@ -138,6 +139,25 @@ od_router_transaction(od_client_t *client) } break; } + + /* CopyInResponse */ + if (type == 'G') { + od_routerstatus_t copy_rc; + copy_rc = od_router_copy_in(client); + if (copy_rc != OD_RS_OK) + return copy_rc; + continue; + } + /* CopyOutResponse */ + if (type == 'H') { + assert(! server->is_copy); + server->is_copy = 1; + continue; + } + /* copy out complete */ + if (type == 'c') { + server->is_copy = 0; + } } } return OD_RS_OK;