SICS-760 Add NOREPLY mechanism in aqadapter and asyncqueue
This removes the expectation of a reply when sending is suffixed
with "{0}" or "@@NOREPLY@@" or, for asyncqueue, a custom string.
This commit is contained in:
@@ -127,6 +127,7 @@ static void SCAQTransact(Ascon *a)
|
||||
AsyncUnit *unit = NULL;
|
||||
const char *command = GetCharArray(a->wrBuffer);
|
||||
int cmd_len = GetDynStringLength(a->wrBuffer);
|
||||
int rsp_len = 1024;
|
||||
pp = (pPrivate) a->private;
|
||||
assert(pp);
|
||||
unit = pp->unit;
|
||||
@@ -134,7 +135,15 @@ static void SCAQTransact(Ascon *a)
|
||||
txn = &pp->txn;
|
||||
txn->transWait = 1;
|
||||
DynStringClear(a->rdBuffer);
|
||||
AsyncUnitSendTxn(unit, command, cmd_len, TransCallback, a, 1024);
|
||||
if (cmd_len > 3 && strncmp(&command[cmd_len - 3], "{0}", 3) == 0) {
|
||||
rsp_len = 0;
|
||||
cmd_len -= 3;
|
||||
}
|
||||
else if (cmd_len > 11 && strncasecmp(&command[cmd_len - 11], "@@NOREPLY@@", 11) == 0) {
|
||||
rsp_len = 0;
|
||||
cmd_len -= 11;
|
||||
}
|
||||
AsyncUnitSendTxn(unit, command, cmd_len, TransCallback, a, rsp_len);
|
||||
}
|
||||
|
||||
static int scaqaNullHandler(Ascon *a)
|
||||
|
||||
Reference in New Issue
Block a user