fonts: Continue when font calls return Suspended more than once
Patch3ab6cd31cb
fixed Xinerama interactions with font servers by not putting clients to sleep multiple times. However, it introduced additional changes dealing with libXfont routine returning Suspended more than once for the same request. This additional change was to abandon processing of the current request and free the closure data by jumping to 'xinerama_sleep' in each of the functions. Font library functions shouldn't return Suspended more than once, except for ListFontsWithInfo, which produces multiple replies, and thus ends up returning Suspended many times during processing. With the jump to xinerama_sleep occurring after the first reply was processed, the closure for the request was freed and future calls into the ListFontsWithInfo callback resulted in dereferencing freed memory. This patch removes the added branches, reverting the code to its previous behaviour, which permitted multiple Suspended returns and simply waited for the client to be signaled again so that the callback could continue processing the request. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com> (cherry picked from commitf9a04d19ae
)
This commit is contained in:
parent
82000d6d03
commit
0ca79007c9
|
@ -314,8 +314,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
|
|||
if (err == Suspended) {
|
||||
if (!ClientIsAsleep(client))
|
||||
ClientSleep(client, (ClientSleepProcPtr) doOpenFont, c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
@ -363,7 +361,6 @@ doOpenFont(ClientPtr client, OFclosurePtr c)
|
|||
c->fontid, FontToXError(err));
|
||||
}
|
||||
ClientWakeup(c->client);
|
||||
xinerama_sleep:
|
||||
for (i = 0; i < c->num_fpes; i++) {
|
||||
FreeFPE(c->fpe_list[i]);
|
||||
}
|
||||
|
@ -596,8 +593,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
|||
if (!ClientIsAsleep(client))
|
||||
ClientSleep(client,
|
||||
(ClientSleepProcPtr) doListFontsAndAliases, c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -623,8 +618,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
|||
ClientSleep(client,
|
||||
(ClientSleepProcPtr) doListFontsAndAliases,
|
||||
c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
if (err == Successful)
|
||||
|
@ -642,8 +635,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
|||
ClientSleep(client,
|
||||
(ClientSleepProcPtr) doListFontsAndAliases,
|
||||
c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
if (err == FontNameAlias) {
|
||||
|
@ -788,7 +779,6 @@ doListFontsAndAliases(ClientPtr client, LFclosurePtr c)
|
|||
|
||||
bail:
|
||||
ClientWakeup(client);
|
||||
xinerama_sleep:
|
||||
for (i = 0; i < c->num_fpes; i++)
|
||||
FreeFPE(c->fpe_list[i]);
|
||||
free(c->fpe_list);
|
||||
|
@ -888,8 +878,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
if (!ClientIsAsleep(client))
|
||||
ClientSleep(client,
|
||||
(ClientSleepProcPtr) doListFontsWithInfo, c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
if (err == Successful)
|
||||
|
@ -905,8 +893,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
if (!ClientIsAsleep(client))
|
||||
ClientSleep(client,
|
||||
(ClientSleepProcPtr) doListFontsWithInfo, c);
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
@ -1040,7 +1026,6 @@ doListFontsWithInfo(ClientPtr client, LFWIclosurePtr c)
|
|||
WriteSwappedDataToClient(client, length, &finalReply);
|
||||
bail:
|
||||
ClientWakeup(client);
|
||||
xinerama_sleep:
|
||||
for (i = 0; i < c->num_fpes; i++)
|
||||
FreeFPE(c->fpe_list[i]);
|
||||
free(c->reply);
|
||||
|
@ -1297,8 +1282,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
|||
client_state = START_SLEEP;
|
||||
continue; /* on to steps 3 and 4 */
|
||||
}
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
else if (lgerr != Successful) {
|
||||
|
@ -1352,7 +1335,6 @@ doPolyText(ClientPtr client, PTclosurePtr c)
|
|||
}
|
||||
if (ClientIsAsleep(client)) {
|
||||
ClientWakeup(c->client);
|
||||
xinerama_sleep:
|
||||
ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
|
||||
|
||||
/* Unreference the font from the scratch GC */
|
||||
|
@ -1477,8 +1459,6 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
|||
|
||||
ClientSleep(client, (ClientSleepProcPtr) doImageText, c);
|
||||
}
|
||||
else
|
||||
goto xinerama_sleep;
|
||||
return TRUE;
|
||||
}
|
||||
else if (lgerr != Successful) {
|
||||
|
@ -1501,7 +1481,6 @@ doImageText(ClientPtr client, ITclosurePtr c)
|
|||
}
|
||||
if (ClientIsAsleep(client)) {
|
||||
ClientWakeup(c->client);
|
||||
xinerama_sleep:
|
||||
ChangeGC(NullClient, c->pGC, clearGCmask, clearGC);
|
||||
|
||||
/* Unreference the font from the scratch GC */
|
||||
|
|
Loading…
Reference in New Issue
Block a user