memset(rates, 0, ratelen);
memset(rates, 0xff, ratelen);
static int extract_rates(char *rates, int ratelen, const char *request){    const char *p;    for (p = request; *p && *p != '\r' && *p != '\n'; ) {        if (strncasecmp(p, "Pragma:", 7) == 0) {            const char *q = p + 7;            while (*q && *q != '\n' && isspace(*q))                q++;            if (strncasecmp(q, "stream-switch-entry=", 20) == 0) {                int stream_no;                int rate_no;                q += 20;                memset(rates, 0, ratelen);                while (1) {                    while (*q && *q != '\n' && *q != ':')                        q++;                    if (sscanf(q, ":%d:%d", &stream_no, &rate_no) != 2) {                        break;                    }                    stream_no--;                    if (stream_no < ratelen && stream_no >= 0) {                        rates[stream_no] = rate_no;                    }                    while (*q && *q != '\n' && !isspace(*q))                        q++;                }                return 1;            }        }        p = strchr(p, '\n');        if (!p)            break;        p++;    }    return 0;}