server boilerplate reduction
This commit is contained in:
+2
-10
@@ -82,8 +82,6 @@ struct ServerGetControl : public server::Get
|
||||
if(!conn || !conn->bev)
|
||||
return;
|
||||
|
||||
const bool be = EPICS_BYTE_ORDER==EPICS_ENDIAN_BIG;
|
||||
|
||||
Status sts{};
|
||||
uint8_t cmd = oper->state==ServerOp::Creating ? 0x08 : oper->lastRequest ? 0x50 : 0x40;
|
||||
|
||||
@@ -123,7 +121,7 @@ struct ServerGetControl : public server::Get
|
||||
{
|
||||
(void)evbuffer_drain(conn->txBody.get(), evbuffer_get_length(conn->txBody.get()));
|
||||
|
||||
EvOutBuf R(be, conn->txBody.get());
|
||||
EvOutBuf R(hostBE, conn->txBody.get());
|
||||
to_wire(R, uint32_t(oper->ioid));
|
||||
to_wire(R, cmd);
|
||||
to_wire(R, sts);
|
||||
@@ -141,13 +139,7 @@ struct ServerGetControl : public server::Get
|
||||
}
|
||||
}
|
||||
|
||||
auto tx = bufferevent_get_output(conn->bev.get());
|
||||
to_evbuf(tx, Header{CMD_GET,
|
||||
pva_flags::Server,
|
||||
uint32_t(evbuffer_get_length(conn->txBody.get()))},
|
||||
be);
|
||||
auto err = evbuffer_add_buffer(tx, conn->txBody.get());
|
||||
assert(!err);
|
||||
conn->enqueueTxBody(CMD_GET);
|
||||
|
||||
if(oper->state == ServerOp::Dead) {
|
||||
conn->opByIOID.erase(oper->ioid);
|
||||
|
||||
Reference in New Issue
Block a user