+#if VAPI_DEBUG
+ unsigned msgid = be16toh (*(u16 *) * msg);
+ if (msgid <= ctx->vl_msg_id_max)
+ {
+ vapi_msg_id_t id = ctx->vl_msg_id_to_vapi_msg_t[msgid];
+ if (id < __vapi_metadata.count)
+ {
+ VAPI_DBG ("recv msg@%p:%u[%s]", *msg, msgid,
+ __vapi_metadata.msgs[id]->name);
+ }
+ else
+ {
+ VAPI_DBG ("recv msg@%p:%u[UNKNOWN]", *msg, msgid);
+ }
+ }
+ else
+ {
+ VAPI_DBG ("recv msg@%p:%u[UNKNOWN]", *msg, msgid);
+ }
+#endif
+ if (ctx->handle_keepalives)
+ {
+ unsigned msgid = be16toh (*(u16 *) * msg);
+ if (msgid ==
+ vapi_lookup_vl_msg_id (ctx, vapi_msg_id_memclnt_keepalive))
+ {
+ vapi_msg_memclnt_keepalive_reply *reply = NULL;
+ do
+ {
+ reply = vapi_msg_alloc (ctx, sizeof (*reply));
+ }
+ while (!reply);
+ reply->header.context = vapi_get_client_index (ctx);
+ reply->header._vl_msg_id =
+ vapi_lookup_vl_msg_id (ctx,
+ vapi_msg_id_memclnt_keepalive_reply);
+ reply->payload.retval = 0;
+ vapi_msg_memclnt_keepalive_reply_hton (reply);
+ while (VAPI_EAGAIN == vapi_send (ctx, reply));
+ vapi_msg_free (ctx, *msg);
+ VAPI_DBG ("autohandled memclnt_keepalive");
+ goto again;
+ }
+ }