static char *qio_channel_websock_handshake_entry(const char *handshake,

                                                 size_t handshake_len,

                                                 const char *name)

{

    char *begin, *end, *ret = NULL;

    char *line = g_strdup_printf("%s%s: ",

                                 QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM,

                                 name);

    begin = g_strstr_len(handshake, handshake_len, line);

    if (begin != NULL) {

        begin += strlen(line);

        end = g_strstr_len(begin, handshake_len - (begin - handshake),

                QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM);

        if (end != NULL) {

            ret = g_strndup(begin, end - begin);

        }

    }

    g_free(line);

    return ret;

}

static char *qio_channel_websock_handshake_entry(const char *handshake,

                                                 size_t handshake_len,

                                                 const char *name)

{

    char *begin, *end, *ret = NULL;

    char *line = g_strdup_printf("%s%s: ",

                                 QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM,

                                 name);

    begin = g_strstr_len(handshake, handshake_len, line);

    if (begin != NULL) {

        begin += strlen(line);

        end = g_strstr_len(begin, handshake_len - (begin - handshake),

                QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM);

        if (end != NULL) {

            ret = g_strndup(begin, end - begin);

        }

    }

    g_free(line);

    return ret;

}

static char *qio_channel_websock_handshake_entry(const char *handshake,                                                  size_t handshake_len,                                                  const char *name)     char *begin, *end, *ret = NULL;     char *line = g_strdup_printf("%s%s: ",                                  QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM,                                  name);     begin = g_strstr_len(handshake, handshake_len, line);     if (begin != NULL) {         begin += strlen(line);         end = g_strstr_len(begin, handshake_len - (begin - handshake),                 QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM);         if (end != NULL) {             ret = g_strndup(begin, end - begin);     g_free(line);     return ret;     return ret;
static char *FUNC_0(const char *VAR_0,

                                                 size_t VAR_1,

                                                 const char *VAR_2)

{

    char *VAR_3, *VAR_4, *VAR_5 = NULL;

    char *VAR_6 = g_strdup_printf("%s%s: ",

                                 QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM,

                                 VAR_2);

    VAR_3 = g_strstr_len(VAR_0, VAR_1, VAR_6);

    if (VAR_3 != NULL) {

        VAR_3 += strlen(VAR_6);

        VAR_4 = g_strstr_len(VAR_3, VAR_1 - (VAR_3 - VAR_0),

                QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM);

        if (VAR_4 != NULL) {

            VAR_5 = g_strndup(VAR_3, VAR_4 - VAR_3);

        }

    }

    g_free(VAR_6);

    return VAR_5;

}

static char *FUNC_0(const char *VAR_0,
size_t VAR_1,
const char *VAR_2)
{ char *VAR_3, *VAR_4, *VAR_5 = NULL; char *VAR_6 = g_strdup_printf("%s%s: ",
QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM,
VAR_2); VAR_3 = g_strstr_len(VAR_0, VAR_1, VAR_6); if (VAR_3 != NULL) { VAR_3 += strlen(VAR_6); VAR_4 = g_strstr_len(VAR_3, VAR_1 - (VAR_3 - VAR_0),
QIO_CHANNEL_WEBSOCK_HANDSHAKE_DELIM); if (VAR_4 != NULL) { VAR_5 = g_strndup(VAR_3, VAR_4 - VAR_3); } } g_free(VAR_6); return VAR_5; }