(handlers[input->op].handler != NULL) &&
(input->requestSize >= handlers[input->op].minReqSize)) {
/* Initial validation passed, process the client request now. */
- packet->processedAsync = (handlers[input->op].reqType == REQ_ASYNC) &&
- (transportSession->channelCapabilities.flags & HGFS_CHANNEL_ASYNC);
- ;
- if (packet->processedAsync) {
+ if ((handlers[input->op].reqType == REQ_ASYNC) &&
+ (transportSession->channelCapabilities.flags & HGFS_CHANNEL_ASYNC)) {
+ packet->state |= HGFS_STATE_ASYNC_REQUEST;
+ }
+ if (0 != (packet->state & HGFS_STATE_ASYNC_REQUEST)) {
LOG(4, ("%s: %d: @@Async\n", __FUNCTION__, __LINE__));
#ifndef VMX86_TOOLS
/*
{
HgfsTransportSessionInfo *transportSession = clientData;
- if (packet->guestInitiated) {
+ if (0 != (packet->state & HGFS_STATE_CLIENT_REQUEST)) {
HSPU_PutMetaPacket(packet, transportSession->channelCbTable);
HSPU_PutReplyPacket(packet, transportSession->channelCbTable);
HSPU_PutDataPacketBuf(packet, transportSession->channelCbTable);
HgfsSendFlags flags) // IN: flags for how to process
{
Bool result = FALSE;
- Bool notificationNeeded = packet->guestInitiated && packet->processedAsync;
+ Bool notificationNeeded = (0 != (packet->state & HGFS_STATE_CLIENT_REQUEST) &&
+ 0 != (packet->state & HGFS_STATE_ASYNC_REQUEST));
ASSERT(packet);
ASSERT(transportSession);
packetHeader = Util_SafeCalloc(1, sizeNeeded);
packet = Util_SafeCalloc(1, sizeof *packet);
- packet->guestInitiated = FALSE;
+ packet->state &= ~HGFS_STATE_CLIENT_REQUEST;
packet->metaPacketSize = sizeNeeded;
packet->metaPacket = packetHeader;
packet->dataPacketIsAllocated = TRUE;
packet.metaPacketSize = packetInSize;
packet.replyPacket = packetOut;
packet.replyPacketSize = *packetOutSize;
- /* Misnomer to be fixed, guestInitiated really means client initiated */
- packet.guestInitiated = TRUE;
+ packet.state |= HGFS_STATE_CLIENT_REQUEST;
/* The server will perform a synchronous processing of requests. */
connData->serverCbTable->receive(&packet, connData->serverSession);
BUF_READWRITEABLE, /* Establish read-writeable mappings */
} MappingType;
+typedef uint64 HgfsStateFlags;
+#define HGFS_STATE_CLIENT_REQUEST (1 << 0)
+#define HGFS_STATE_ASYNC_REQUEST (1 << 1)
typedef
struct HgfsPacket {
uint64 id;
- /* Does transport need to send Async reply ? */
- Bool processedAsync;
-
- /* Is the packet guest initiated ? */
- Bool guestInitiated;
+ HgfsStateFlags state;
/* For metapacket we always establish writeable mappings */
void *metaPacket;