Commit 25677711 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

NXDispatch.c: mark NX changes

parent 2b9a6ddc
...@@ -245,6 +245,7 @@ Dispatch(void) ...@@ -245,6 +245,7 @@ Dispatch(void)
InitSelections(); InitSelections();
nClients = 0; nClients = 0;
#ifdef NXAGENT_SERVER
/* /*
* The agent initialization was successfully * The agent initialization was successfully
* completed. We can now handle our clients. * completed. We can now handle our clients.
...@@ -269,10 +270,12 @@ Dispatch(void) ...@@ -269,10 +270,12 @@ Dispatch(void)
#endif #endif
#endif /* NXAGENT_SERVER */
clientReady = (int *) malloc(sizeof(int) * MaxClients); clientReady = (int *) malloc(sizeof(int) * MaxClients);
if (!clientReady) if (!clientReady)
return; return;
#ifdef NXAGENT_SERVER
#ifdef WATCH #ifdef WATCH
fprintf(stderr, "Dispatch: Watchpoint 12.\n"); fprintf(stderr, "Dispatch: Watchpoint 12.\n");
...@@ -303,6 +306,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -303,6 +306,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (!(dispatchException & DE_TERMINATE)) if (!(dispatchException & DE_TERMINATE))
dispatchException = 0; dispatchException = 0;
#endif /* NXAGENT_SERVER */
while (!dispatchException) while (!dispatchException)
{ {
...@@ -312,6 +316,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -312,6 +316,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
FlushIfCriticalOutputPending(); FlushIfCriticalOutputPending();
} }
#ifdef NXAGENT_SERVER
/* /*
* Ensure we remove the splash after the timeout. * Ensure we remove the splash after the timeout.
* Initializing clientReady[0] to -1 will tell * Initializing clientReady[0] to -1 will tell
...@@ -351,9 +356,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -351,9 +356,11 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[End dispatch]\n"); fprintf(stderr, "[End dispatch]\n");
#endif #endif
#endif /* NXAGENT_SERVER */
nready = WaitForSomething(clientReady); nready = WaitForSomething(clientReady);
#ifdef NXAGENT_SERVER
#ifdef BLOCKS #ifdef BLOCKS
fprintf(stderr, "[Begin dispatch]\n"); fprintf(stderr, "[Begin dispatch]\n");
#endif #endif
...@@ -378,6 +385,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -378,6 +385,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
nxagentClients = nClients; nxagentClients = nClients;
#endif #endif
#endif /* NXAGENT_SERVER */
if (nready) if (nready)
{ {
...@@ -423,10 +431,12 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -423,10 +431,12 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
} }
/* now, finally, deal with client requests */ /* now, finally, deal with client requests */
#ifdef NXAGENT_SERVER
#ifdef TEST #ifdef TEST
fprintf(stderr, "******Dispatch: Reading request from client [%d].\n", fprintf(stderr, "******Dispatch: Reading request from client [%d].\n",
client->index); client->index);
#endif #endif
#endif /* NXAGENT_SERVER */
result = ReadRequestFromClient(client); result = ReadRequestFromClient(client);
if (result <= 0) if (result <= 0)
...@@ -435,8 +445,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -435,8 +445,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
CloseDownClient(client); CloseDownClient(client);
break; break;
} }
#ifdef NXAGENT_SERVER
#ifdef NXAGENT_SERVER
#ifdef TEST #ifdef TEST
else else
...@@ -463,10 +473,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -463,10 +473,9 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
if (result > (maxBigRequestSize << 2)) if (result > (maxBigRequestSize << 2))
result = BadLength; result = BadLength;
else else
#ifdef NXAGENT_SERVER
{ {
result = (* client->requestVector[MAJOROP])(client); result = (* client->requestVector[MAJOROP])(client);
#ifdef NXAGENT_SERVER
#ifdef TEST #ifdef TEST
if (MAJOROP > 127) if (MAJOROP > 127)
...@@ -492,11 +501,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -492,11 +501,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
*/ */
nxagentDispatchHandler(client, client->req_len << 2, 0); nxagentDispatchHandler(client, client->req_len << 2, 0);
}
#else
result = (* client->requestVector[MAJOROP])(client);
#endif #endif
}
if (!SmartScheduleSignalEnable) if (!SmartScheduleSignalEnable)
SmartScheduleTime = GetTimeInMillis(); SmartScheduleTime = GetTimeInMillis();
...@@ -526,6 +532,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -526,6 +532,8 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
#if defined(DDXBEFORERESET) #if defined(DDXBEFORERESET)
ddxBeforeReset (); ddxBeforeReset ();
#endif #endif
#ifdef NXAGENT_SERVER
/* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */ /* FIXME: maybe move the code up to the KillAllClients() call to ddxBeforeReset? */
if ((dispatchException & DE_RESET) && if ((dispatchException & DE_RESET) &&
(serverGeneration > nxagentMaxAllowedResets)) (serverGeneration > nxagentMaxAllowedResets))
...@@ -559,6 +567,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -559,6 +567,7 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
NXShadowDestroy(); NXShadowDestroy();
} }
saveAgentState("TERMINATED"); saveAgentState("TERMINATED");
#endif /* NXAGENT_SERVER */
KillAllClients(); KillAllClients();
free(clientReady); free(clientReady);
...@@ -580,7 +589,9 @@ ProcReparentWindow(register ClientPtr client) ...@@ -580,7 +589,9 @@ ProcReparentWindow(register ClientPtr client)
if (!pWin) if (!pWin)
return(BadWindow); return(BadWindow);
#ifdef NXAGENT_SERVER
nxagentRemoveSplashWindow(); nxagentRemoveSplashWindow();
#endif
pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client, pParent = (WindowPtr)SecurityLookupWindow(stuff->parent, client,
DixWriteAccess); DixWriteAccess);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment