odissey: add copy support for transaction pooling

This commit is contained in:
Dmitry Simonenko 2017-02-17 12:36:06 +03:00
parent 2d40129eb8
commit fde44a5de4
3 changed files with 23 additions and 0 deletions

View File

@ -17,6 +17,7 @@ set(od_src
od_router.c od_router.c
od_router_session.c od_router_session.c
od_router_transaction.c od_router_transaction.c
od_router_copy.c
od_cancel.c od_cancel.c
od_auth.c od_auth.c
od_periodic.c od_periodic.c

View File

@ -135,11 +135,13 @@ od_router_session(od_client_t *client)
copy_rc = od_router_copy_in(client); copy_rc = od_router_copy_in(client);
if (copy_rc != OD_RS_OK) if (copy_rc != OD_RS_OK)
return copy_rc; return copy_rc;
continue;
} }
/* CopyOutResponse */ /* CopyOutResponse */
if (type == 'H') { if (type == 'H') {
assert(! server->is_copy); assert(! server->is_copy);
server->is_copy = 1; server->is_copy = 1;
continue;
} }
/* copy out complete */ /* copy out complete */
if (type == 'c') { if (type == 'c') {

View File

@ -36,6 +36,7 @@
#include "od_router.h" #include "od_router.h"
#include "od_router_session.h" #include "od_router_session.h"
#include "od_router_transaction.h" #include "od_router_transaction.h"
#include "od_router_copy.h"
#include "od_cancel.h" #include "od_cancel.h"
#include "od_fe.h" #include "od_fe.h"
#include "od_be.h" #include "od_be.h"
@ -138,6 +139,25 @@ od_router_transaction(od_client_t *client)
} }
break; 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; return OD_RS_OK;