~ubuntu-branches/ubuntu/precise/libxfont/precise-security

« back to all changes in this revision

Viewing changes to src/fc/fserve.c

  • Committer: Bazaar Package Importer
  • Author(s): Bryce Harrington
  • Date: 2007-07-18 16:46:59 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20070718164659-h894n91b3dynfwi2
Tags: 1:1.3.0-0ubuntu1
* New upstream release.
* debian/control:
  - Maintainer field updated
* debian/copyright:
  - Added packaging copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
130
130
 
131
131
char _fs_glyph_undefined;
132
132
char _fs_glyph_requested;
133
 
char _fs_glyph_zero_length;
 
133
static char _fs_glyph_zero_length;
134
134
 
135
135
static int  generationCount;
136
136
 
137
 
int FontServerRequestTimeout = 30 * 1000;
 
137
static int FontServerRequestTimeout = 30 * 1000;
138
138
 
139
139
static void
140
140
_fs_close_server (FSFpePtr conn);
2046
2046
                                   doesn't conflict with existing
2047
2047
                                   client values. */
2048
2048
 
2049
 
int
2050
 
fs_load_all_glyphs(FontPtr pfont)
2051
 
{
2052
 
    int         err;
2053
 
    FSFpePtr    conn = (FSFpePtr) pfont->fpe->private;
2054
 
 
2055
 
    /*
2056
 
     * The purpose of this procedure is to load all glyphs in the event
2057
 
     * that we're dealing with someone who doesn't understand the finer
2058
 
     * points of glyph caching...  it is called from _fs_get_glyphs() if
2059
 
     * the latter is called to get glyphs that have not yet been loaded.
2060
 
     * We assume that the caller will not know how to handle a return
2061
 
     * value of Suspended (usually the case for a GetGlyphs() caller),
2062
 
     * so this procedure hangs around, freezing the server, for the
2063
 
     * request to complete.  This is an unpleasant kluge called to
2064
 
     * perform an unpleasant job that, we hope, will never be required.
2065
 
     */
2066
 
 
2067
 
    while ((err = _fs_load_glyphs(serverClient, pfont, TRUE, 0, 0, NULL)) ==
2068
 
           Suspended)
2069
 
    {
2070
 
        if (fs_await_reply (conn) != FSIO_READY)
2071
 
        {
2072
 
            /* Get rid of blockrec */
2073
 
            fs_client_died(serverClient, pfont->fpe);
2074
 
            err = BadCharRange;
2075
 
            break;
2076
 
        }
2077
 
        fs_read_reply (pfont->fpe, serverClient);
2078
 
    }
2079
 
    return err;
2080
 
}
2081
 
 
2082
 
 
2083
 
int
 
2049
static int
2084
2050
_fs_load_glyphs(pointer client, FontPtr pfont, Bool range_flag, 
2085
2051
                unsigned int nchars, int item_size, unsigned char *data)
2086
2052
{
2230
2196
    return fs_send_load_glyphs(client, pfont, nranges, ranges);
2231
2197
}
2232
2198
 
 
2199
int
 
2200
fs_load_all_glyphs(FontPtr pfont)
 
2201
{
 
2202
    int         err;
 
2203
    FSFpePtr    conn = (FSFpePtr) pfont->fpe->private;
 
2204
 
 
2205
    /*
 
2206
     * The purpose of this procedure is to load all glyphs in the event
 
2207
     * that we're dealing with someone who doesn't understand the finer
 
2208
     * points of glyph caching...  it is called from _fs_get_glyphs() if
 
2209
     * the latter is called to get glyphs that have not yet been loaded.
 
2210
     * We assume that the caller will not know how to handle a return
 
2211
     * value of Suspended (usually the case for a GetGlyphs() caller),
 
2212
     * so this procedure hangs around, freezing the server, for the
 
2213
     * request to complete.  This is an unpleasant kluge called to
 
2214
     * perform an unpleasant job that, we hope, will never be required.
 
2215
     */
 
2216
 
 
2217
    while ((err = _fs_load_glyphs(serverClient, pfont, TRUE, 0, 0, NULL)) ==
 
2218
           Suspended)
 
2219
    {
 
2220
        if (fs_await_reply (conn) != FSIO_READY)
 
2221
        {
 
2222
            /* Get rid of blockrec */
 
2223
            fs_client_died(serverClient, pfont->fpe);
 
2224
            err = BadCharRange;
 
2225
            break;
 
2226
        }
 
2227
        fs_read_reply (pfont->fpe, serverClient);
 
2228
    }
 
2229
    return err;
 
2230
}
 
2231
 
2233
2232
static int
2234
2233
fs_read_list(FontPathElementPtr fpe, FSBlockDataPtr blockrec)
2235
2234
{
2779
2778
static int
2780
2779
_fs_recv_conn_setup (FSFpePtr conn)
2781
2780
{
2782
 
    int                 ret;
 
2781
    int                 ret = FSIO_ERROR;
2783
2782
    fsConnSetup         *setup;
2784
2783
    FSFpeAltPtr         alts;
2785
2784
    int                 i, alt_len;