Package org.glassfish.grizzly.http

Examples of org.glassfish.grizzly.http.LazyCookieState


        int valueStart;
        int valueEnd;
        int version = 0;

        Cookie cookie = null;
        LazyCookieState lazyCookie = null;

        boolean isSpecial;
        boolean isQuoted;

        while (pos < end) {
            isSpecial = false;
            isQuoted = false;

            // Skip whitespace and non-token characters (separators)
            while (pos < end
                    && (isSeparator(buffer.get(pos)) || isWhiteSpace(buffer.get(pos)))) {
                pos++;
            }

            if (pos >= end) {
                return;
            }

            // Detect Special cookies
            if (buffer.get(pos) == '$') {
                isSpecial = true;
                pos++;
            }

            // Get the cookie name. This must be a token
            nameStart = pos;
            pos = nameEnd = getTokenEndPosition(buffer, pos, end);

            // Skip whitespace
            while (pos < end && isWhiteSpace(buffer.get(pos))) {
                pos++;
            }

            // Check for an '=' -- This could also be a name-only
            // cookie at the end of the cookie header, so if we
            // are past the end of the header, but we have a name
            // skip to the name-only part.
            if (pos < end && buffer.get(pos) == '=') {

                // Skip whitespace
                do {
                    pos++;
                } while (pos < end && isWhiteSpace(buffer.get(pos)));

                if (pos >= end) {
                    return;
                }

                // Determine what type of value this is, quoted value,
                // token, name-only with an '=', or other (bad)
                switch (buffer.get(pos)) {
                    case '"':
                        // Quoted Value
                        isQuoted = true;
                        valueStart = pos + 1; // strip "
                        // getQuotedValue returns the position before
                        // at the last qoute. This must be dealt with
                        // when the bytes are copied into the cookie
                        valueEnd = getQuotedValueEndPosition(buffer,
                                valueStart, end);
                        // We need pos to advance
                        pos = valueEnd;
                        // Handles cases where the quoted value is
                        // unterminated and at the end of the header,
                        // e.g. [myname="value]
                        if (pos >= end) {
                            return;
                        }
                        break;
                    case ';':
                    case ',':
                        // Name-only cookie with an '=' after the name token
                        // This may not be RFC compliant
                        valueStart = valueEnd = -1;
                        // The position is OK (On a delimiter)
                        break;
                    default:
                        if (!isSeparator(buffer.get(pos), versionOneStrictCompliance)) {
                        // Token
                            // Token
                            valueStart = pos;
                            // getToken returns the position at the delimeter
                            // or other non-token character
                            valueEnd = getTokenEndPosition(buffer, valueStart, end,
                                versionOneStrictCompliance);
                            // We need pos to advance
                            pos = valueEnd;
                        } else {
                            // INVALID COOKIE, advance to next delimiter
                            // The starting character of the cookie value was
                            // not valid.
                            LOGGER.fine("Invalid cookie. Value not a token or quoted value");
                            while (pos < end && buffer.get(pos) != ';'
                                    && buffer.get(pos) != ',') {
                                pos++;
                            }

                            pos++;
                            // Make sure no special avpairs can be attributed to
                            // the previous cookie by setting the current cookie
                            // to null
                            cookie = null;
                            lazyCookie = null;
                            continue;
                        }
                }
            } else {
                // Name only cookie
                valueStart = valueEnd = -1;
                pos = nameEnd;

            }

            // We should have an avpair or name-only cookie at this
            // point. Perform some basic checks to make sure we are
            // in a good state.

            // Skip whitespace
            while (pos < end && isWhiteSpace(buffer.get(pos))) {
                pos++;
            }

            // Make sure that after the cookie we have a separator. This
            // is only important if this is not the last cookie pair
            while (pos < end && buffer.get(pos) != ';' && buffer.get(pos) != ',') {
                pos++;
            }

            pos++;

            // All checks passed. Add the cookie, start with the
            // special avpairs first
            if (isSpecial) {
                isSpecial = false;
                // $Version must be the first avpair in the cookie header
                // (sc must be null)
                if (CookieUtils.equals("Version", buffer, nameStart, nameEnd)
                        && cookie == null) {
                    if (rfc6265Enabled) {
                        continue;
                    }
                    // Set version
                    if (buffer.get(valueStart) == '1'
                            && valueEnd == (valueStart + 1)) {
                        version = 1;
                    } else {
                        // unknown version (Versioning is not very strict)
                    }
                    continue;
                }

                // We need an active cookie for Path/Port/etc.
                if (cookie == null) {
                    continue;
                }

                // Domain is more common, so it goes first
                if (CookieUtils.equals("Domain", buffer, nameStart, nameEnd)) {
                    lazyCookie.getDomain().setBuffer(buffer,
                            valueStart, valueEnd);
                    continue;
                }

                if (CookieUtils.equals("Path", buffer, nameStart, nameEnd)) {
                    lazyCookie.getPath().setBuffer(buffer,
                            valueStart, valueEnd);
                    continue;
                }


//                if (CookieUtils.equals("Port", buffer, nameStart, nameEnd)) {
//                    // sc.getPort is not currently implemented.
//                    // sc.getPort().setBytes( bytes,
//                    //                        valueStart,
//                    //                        valueEnd-valueStart );
//                    continue;
//                }

                // Unknown cookie, complain
                LOGGER.fine("Unknown Special Cookie");

            } else { // Normal Cookie
                cookie = cookies.getNextUnusedCookie();
                lazyCookie = cookie.getLazyCookieState();
                if (!rfc6265Enabled && !cookie.isVersionSet()) {
                    cookie.setVersion(version);
                }
                lazyCookie.getName().setBuffer(buffer, nameStart, nameEnd);

                if (valueStart != -1) { // Normal AVPair
                    lazyCookie.getValue().setBuffer(buffer, valueStart, valueEnd);
                    if (isQuoted) {
                        // We know this is a byte value so this is safe
                        unescapeDoubleQuotes(lazyCookie.getValue());
                    }
                } else {
                    // Name Only
                    lazyCookie.getValue().setString("");
                }
            }
        }
    }
View Full Code Here


        int valueStart;
        int valueEnd;
        int version = 0;

        Cookie cookie = null;
        LazyCookieState lazyCookie = null;

        boolean isSpecial;
        boolean isQuoted;

        while (pos < end) {
            isSpecial = false;
            isQuoted = false;

            // Skip whitespace and non-token characters (separators)
            while (pos < end
                    && (isSeparator(bytes[pos]) || isWhiteSpace(bytes[pos]))) {
                pos++;
            }

            if (pos >= end) {
                return;
            }

            // Detect Special cookies
            if (bytes[pos] == '$') {
                isSpecial = true;
                pos++;
            }

            // Get the cookie name. This must be a token
            nameStart = pos;
            pos = nameEnd = getTokenEndPosition(bytes, pos, end);

            // Skip whitespace
            while (pos < end && isWhiteSpace(bytes[pos])) {
                pos++;
            }

            // Check for an '=' -- This could also be a name-only
            // cookie at the end of the cookie header, so if we
            // are past the end of the header, but we have a name
            // skip to the name-only part.
            if (pos < end && bytes[pos] == '=') {

                // Skip whitespace
                do {
                    pos++;
                } while (pos < end && isWhiteSpace(bytes[pos]));

                if (pos >= end) {
                    return;
                }

                // Determine what type of value this is, quoted value,
                // token, name-only with an '=', or other (bad)
                switch (bytes[pos]) {
                    case '"':
                        // Quoted Value
                        isQuoted = true;
                        valueStart = pos + 1; // strip "
                        // getQuotedValue returns the position before
                        // at the last qoute. This must be dealt with
                        // when the bytes are copied into the cookie
                        valueEnd = getQuotedValueEndPosition(bytes,
                                valueStart, end);
                        // We need pos to advance
                        pos = valueEnd;
                        // Handles cases where the quoted value is
                        // unterminated and at the end of the header,
                        // e.g. [myname="value]
                        if (pos >= end) {
                            return;
                        }
                        break;
                    case ';':
                    case ',':
                        // Name-only cookie with an '=' after the name token
                        // This may not be RFC compliant
                        valueStart = valueEnd = -1;
                        // The position is OK (On a delimiter)
                        break;
                    default:
                        if (!isSeparator(bytes[pos], versionOneStrictCompliance)) {
                            // Token
                            // Token
                            valueStart = pos;
                            // getToken returns the position at the delimeter
                            // or other non-token character
                            valueEnd = getTokenEndPosition(bytes, valueStart, end,
                                    versionOneStrictCompliance);
                            // We need pos to advance
                            pos = valueEnd;
                        } else {
                            // INVALID COOKIE, advance to next delimiter
                            // The starting character of the cookie value was
                            // not valid.
                            LOGGER.fine("Invalid cookie. Value not a token or quoted value");
                            while (pos < end && bytes[pos] != ';'
                                    && bytes[pos] != ',') {
                                pos++;
                            }

                            pos++;
                            // Make sure no special avpairs can be attributed to
                            // the previous cookie by setting the current cookie
                            // to null
                            cookie = null;
                            lazyCookie = null;
                            continue;
                        }
                }
            } else {
                // Name only cookie
                valueStart = valueEnd = -1;
                pos = nameEnd;

            }

            // We should have an avpair or name-only cookie at this
            // point. Perform some basic checks to make sure we are
            // in a good state.

            // Skip whitespace
            while (pos < end && isWhiteSpace(bytes[pos])) {
                pos++;
            }

            // Make sure that after the cookie we have a separator. This
            // is only important if this is not the last cookie pair
            while (pos < end && bytes[pos] != ';' && bytes[pos] != ',') {
                pos++;
            }

            pos++;

            // All checks passed. Add the cookie, start with the
            // special avpairs first
            if (isSpecial) {
                isSpecial = false;
                // $Version must be the first avpair in the cookie header
                // (sc must be null)
                if (CookieUtils.equals("Version", bytes, nameStart, nameEnd)
                        && cookie == null) {
                    if (rfc6265Enabled) {
                        continue;
                    }
                    // Set version
                    if (bytes[valueStart] == '1'
                            && valueEnd == (valueStart + 1)) {
                        version = 1;
                    } else {
                        // unknown version (Versioning is not very strict)
                    }
                    continue;
                }

                // We need an active cookie for Path/Port/etc.
                if (cookie == null) {
                    continue;
                }

                // Domain is more common, so it goes first
                if (CookieUtils.equals("Domain", bytes, nameStart, nameEnd)) {
                    lazyCookie.getDomain().setBytes(bytes,
                            valueStart, valueEnd);
                    continue;
                }

                if (CookieUtils.equals("Path", bytes, nameStart, nameEnd)) {
                    lazyCookie.getPath().setBytes(bytes,
                            valueStart, valueEnd);
                    continue;
                }

                // Unknown cookie, complain
                LOGGER.fine("Unknown Special Cookie");

            } else { // Normal Cookie
                cookie = cookies.getNextUnusedCookie();
                lazyCookie = cookie.getLazyCookieState();
                if (!rfc6265Enabled && !cookie.isVersionSet()) {
                    cookie.setVersion(version);
                }
                lazyCookie.getName().setBytes(bytes, nameStart, nameEnd);

                if (valueStart != -1) { // Normal AVPair
                    lazyCookie.getValue().setBytes(bytes, valueStart, valueEnd);
                    if (isQuoted) {
                        // We know this is a byte value so this is safe
                        unescapeDoubleQuotes(lazyCookie.getValue());
                    }
                } else {
                    // Name Only
                    lazyCookie.getValue().setString("");
                }
            }
        }
    }
View Full Code Here

        int nameEnd;
        int valueStart;
        int valueEnd;

        Cookie cookie = null;
        LazyCookieState lazyCookie = null;

        boolean isQuoted;

        while (pos < end) {
            isQuoted = false;

            // Skip whitespace and non-token characters (separators)
            while (pos < end
                    && (isSeparator(bytes[pos]) || isWhiteSpace(bytes[pos]))) {
                pos++;
            }

            if (pos >= end) {
                return;
            }

            // Get the cookie name. This must be a token
            nameStart = pos;
            pos = nameEnd = getTokenEndPosition(bytes, pos, end);

            // Skip whitespace
            while (pos < end && isWhiteSpace(bytes[pos])) {
                pos++;
            }

            // Check for an '=' -- This could also be a name-only
            // cookie at the end of the cookie header, so if we
            // are past the end of the header, but we have a name
            // skip to the name-only part.
            if (pos < end && bytes[pos] == '=') {

                // Skip whitespace
                do {
                    pos++;
                } while (pos < end && isWhiteSpace(bytes[pos]));

                if (pos >= end) {
                    return;
                }

                // Determine what type of value this is, quoted value,
                // token, name-only with an '=', or other (bad)
                switch (bytes[pos]) {
                    case '"':
                        // Quoted Value
                        isQuoted = true;
                        valueStart = pos + 1; // strip "
                        // getQuotedValue returns the position before
                        // at the last qoute. This must be dealt with
                        // when the bytes are copied into the cookie
                        valueEnd = getQuotedValueEndPosition(bytes,
                                valueStart, end);
                        // We need pos to advance
                        pos = valueEnd;
                        // Handles cases where the quoted value is
                        // unterminated and at the end of the header,
                        // e.g. [myname="value]
                        if (pos >= end) {
                            return;
                        }
                        break;
                    case ';':
                    case ',':
                        // Name-only cookie with an '=' after the name token
                        // This may not be RFC compliant
                        valueStart = valueEnd = -1;
                        // The position is OK (On a delimiter)
                        break;
                    default:
                        if (!isSeparator(bytes[pos], versionOneStrictCompliance)) {
                            // Token
                            // Token
                            valueStart = pos;
                            // getToken returns the position at the delimeter
                            // or other non-token character
                            valueEnd = getTokenEndPosition(bytes, valueStart, end,
                                    versionOneStrictCompliance);
                            // We need pos to advance
                            pos = valueEnd;
                        } else {
                            // INVALID COOKIE, advance to next delimiter
                            // The starting character of the cookie value was
                            // not valid.
                            LOGGER.fine("Invalid cookie. Value not a token or quoted value");
                            while (pos < end && bytes[pos] != ';'
                                    && bytes[pos] != ',') {
                                pos++;
                            }

                            pos++;
                            // Make sure no special avpairs can be attributed to
                            // the previous cookie by setting the current cookie
                            // to null
                            cookie = null;
                            lazyCookie = null;
                            continue;
                        }
                }
            } else {
                // Name only cookie
                valueStart = valueEnd = -1;
                pos = nameEnd;

            }

            // We should have an avpair or name-only cookie at this
            // point. Perform some basic checks to make sure we are
            // in a good state.

            // Skip whitespace
            while (pos < end && isWhiteSpace(bytes[pos])) {
                pos++;
            }

            // Make sure that after the cookie we have a separator. This
            // is only important if this is not the last cookie pair
            while (pos < end && bytes[pos] != ';' && bytes[pos] != ',') {
                pos++;
            }

            pos++;

            // All checks passed. Add the cookie, start with the
            // special avpairs first
            if (cookie != null) {
                // Domain is more common, so it goes first
                if (lazyCookie.getDomain().isNull() &&
                        equalsIgnoreCase("Domain", bytes, nameStart, nameEnd)) {
                    lazyCookie.getDomain().setBytes(bytes,
                            valueStart, valueEnd);
                    continue;
                }

                // Path
                if (lazyCookie.getPath().isNull() &&
                        equalsIgnoreCase("Path", bytes, nameStart, nameEnd)) {
                    lazyCookie.getPath().setBytes(bytes,
                            valueStart, valueEnd);
                    continue;
                }

                // Version
                if (CookieUtils.equals("Version", bytes, nameStart, nameEnd)) {
                    if (rfc6265Enabled) {
                        continue;
                    }
                    // Set version
                    if (bytes[valueStart] == '1'
                            && valueEnd == (valueStart + 1)) {
                        cookie.setVersion(1);
                    } else {
                        // unknown version (Versioning is not very strict)
                    }
                    continue;
                }

                // Comment
                if (lazyCookie.getComment().isNull() &&
                        CookieUtils.equals("Comment", bytes, nameStart, nameEnd)) {
                    lazyCookie.getComment().setBytes(bytes,
                            valueStart, valueEnd);
                    continue;
                }

                // Max-Age
                if (cookie.getMaxAge() == -1 &&
                        CookieUtils.equals("Max-Age", bytes, nameStart, nameEnd)) {
                    cookie.setMaxAge(Ascii.parseInt(bytes,
                            valueStart,
                            valueEnd - valueStart));
                    continue;
                }

                // Expires
                if ((cookie.getVersion() == 0 || !cookie.isVersionSet()) && cookie.getMaxAge() == -1 &&
                        equalsIgnoreCase("Expires", bytes, nameStart, nameEnd)) {
                    try {
                        valueEnd = getTokenEndPosition(bytes, valueEnd + 1, end, false);
                        pos = valueEnd + 1;

                        final String expiresDate = new String(bytes,
                                valueStart, valueEnd - valueStart,
                                Charsets.ASCII_CHARSET);

                        final Date date = OLD_COOKIE_FORMAT.get().parse(expiresDate);
                        cookie.setMaxAge(getMaxAgeDelta(date.getTime(), System.currentTimeMillis()) / 1000);
                    } catch (ParseException ignore) {
                    }

                    continue;
                }

                // Secure
                if (!cookie.isSecure() &&
                        equalsIgnoreCase("Secure", bytes, nameStart, nameEnd)) {
                    lazyCookie.setSecure(true);
                    continue;
                }

                // HttpOnly
                if (!cookie.isHttpOnly() &&
                        CookieUtils.equals("HttpOnly", bytes, nameStart, nameEnd)) {
                    cookie.setHttpOnly(true);
                    continue;
                }

                if (CookieUtils.equals("Discard", bytes, nameStart, nameEnd)) {
                    continue;
                }
            }

            // Normal Cookie
            cookie = cookies.getNextUnusedCookie();
            if (!rfc6265Enabled && !cookie.isVersionSet()) {
                cookie.setVersion(0);
            }
            lazyCookie = cookie.getLazyCookieState();

            lazyCookie.getName().setBytes(bytes, nameStart, nameEnd);

            if (valueStart != -1) { // Normal AVPair
                lazyCookie.getValue().setBytes(bytes, valueStart, valueEnd);
                if (isQuoted) {
                    // We know this is a byte value so this is safe
                    unescapeDoubleQuotes(lazyCookie.getValue());
                }
            } else {
                // Name Only
                lazyCookie.getValue().setString("");
            }
        }
    }
View Full Code Here

        int nameEnd;
        int valueStart;
        int valueEnd;

        Cookie cookie = null;
        LazyCookieState lazyCookie = null;

        boolean isQuoted;

        while (pos < end) {
            isQuoted = false;

            // Skip whitespace and non-token characters (separators)
            while (pos < end
                    && (isSeparator(buffer.get(pos)) || isWhiteSpace(buffer.get(pos)))) {
                pos++;
            }

            if (pos >= end) {
                return;
            }

            // Get the cookie name. This must be a token
            nameStart = pos;
            pos = nameEnd = getTokenEndPosition(buffer, pos, end);

            // Skip whitespace
            while (pos < end && isWhiteSpace(buffer.get(pos))) {
                pos++;
            }

            // Check for an '=' -- This could also be a name-only
            // cookie at the end of the cookie header, so if we
            // are past the end of the header, but we have a name
            // skip to the name-only part.
            if (pos < end && buffer.get(pos) == '=') {

                // Skip whitespace
                do {
                    pos++;
                } while (pos < end && isWhiteSpace(buffer.get(pos)));

                if (pos >= end) {
                    return;
                }

                // Determine what type of value this is, quoted value,
                // token, name-only with an '=', or other (bad)
                switch (buffer.get(pos)) {
                    case '"':
                        // Quoted Value
                        isQuoted = true;
                        valueStart = pos + 1; // strip "
                        // getQuotedValue returns the position before
                        // at the last qoute. This must be dealt with
                        // when the bytes are copied into the cookie
                        valueEnd = getQuotedValueEndPosition(buffer,
                                valueStart, end);
                        // We need pos to advance
                        pos = valueEnd;
                        // Handles cases where the quoted value is
                        // unterminated and at the end of the header,
                        // e.g. [myname="value]
                        if (pos >= end) {
                            return;
                        }
                        break;
                    case ';':
                    case ',':
                        // Name-only cookie with an '=' after the name token
                        // This may not be RFC compliant
                        valueStart = valueEnd = -1;
                        // The position is OK (On a delimiter)
                        break;
                    default:
                        if (!isSeparator(buffer.get(pos), versionOneStrictCompliance)) {
                        // Token
                            // Token
                            valueStart = pos;
                            // getToken returns the position at the delimeter
                            // or other non-token character
                            valueEnd = getTokenEndPosition(buffer, valueStart, end,
                                versionOneStrictCompliance);
                            // We need pos to advance
                            pos = valueEnd;
                        } else {
                            // INVALID COOKIE, advance to next delimiter
                            // The starting character of the cookie value was
                            // not valid.
                            LOGGER.fine("Invalid cookie. Value not a token or quoted value");
                            while (pos < end && buffer.get(pos) != ';'
                                    && buffer.get(pos) != ',') {
                                pos++;
                            }

                            pos++;
                            // Make sure no special avpairs can be attributed to
                            // the previous cookie by setting the current cookie
                            // to null
                            cookie = null;
                            lazyCookie = null;
                            continue;
                        }
                }
            } else {
                // Name only cookie
                valueStart = valueEnd = -1;
                pos = nameEnd;

            }

            // We should have an avpair or name-only cookie at this
            // point. Perform some basic checks to make sure we are
            // in a good state.

            // Skip whitespace
            while (pos < end && isWhiteSpace(buffer.get(pos))) {
                pos++;
            }

            // Make sure that after the cookie we have a separator. This
            // is only important if this is not the last cookie pair
            while (pos < end && buffer.get(pos) != ';' && buffer.get(pos) != ',') {
                pos++;
            }

            pos++;

            // All checks passed. Add the cookie, start with the
            // special avpairs first
            if (cookie != null) {
                // Domain is more common, so it goes first
                if (lazyCookie.getDomain().isNull() &&
                        equalsIgnoreCase("Domain", buffer, nameStart, nameEnd)) {
                    lazyCookie.getDomain().setBuffer(buffer,
                            valueStart, valueEnd);
                    continue;
                }

                // Path
                if (lazyCookie.getPath().isNull() &&
                        equalsIgnoreCase("Path", buffer, nameStart, nameEnd)) {
                    lazyCookie.getPath().setBuffer(buffer,
                            valueStart, valueEnd);
                    continue;
                }

                // Version
                if (CookieUtils.equals("Version", buffer, nameStart, nameEnd)) {
                    if (rfc6265Enabled) {
                        continue;
                    }
                    // Set version
                    if (buffer.get(valueStart) == '1'
                            && valueEnd == (valueStart + 1)) {
                        cookie.setVersion(1);
                    } else {
                        // unknown version (Versioning is not very strict)
                    }
                    continue;
                }

                // Comment
                if (lazyCookie.getComment().isNull() &&
                        CookieUtils.equals("Comment", buffer, nameStart, nameEnd)) {
                    lazyCookie.getComment().setBuffer(buffer,
                            valueStart, valueEnd);
                    continue;
                }

                // Max-Age
                if (cookie.getMaxAge() == -1 &&
                        CookieUtils.equals("Max-Age", buffer, nameStart, nameEnd)) {
                    cookie.setMaxAge(Ascii.parseInt(buffer,
                            valueStart,
                            valueEnd - valueStart));
                    continue;
                }

                // Expires
                if ((cookie.getVersion() == 0 || !cookie.isVersionSet()) && cookie.getMaxAge() == -1 &&
                        equalsIgnoreCase("Expires", buffer, nameStart, nameEnd)) {
                    try {
                        valueEnd = getTokenEndPosition(buffer, valueEnd + 1, end, false);
                        pos = valueEnd + 1;

                        final String expiresDate =
                                buffer.toStringContent(Charsets.ASCII_CHARSET,
                                                       valueStart,
                                                       valueEnd);
                        final Date date = OLD_COOKIE_FORMAT.get().parse(expiresDate);
                        cookie.setMaxAge(getMaxAgeDelta(date.getTime(), System.currentTimeMillis()) / 1000);
                    } catch (ParseException ignore) {
                    }

                    continue;
                }

                // Secure
                if (!cookie.isSecure() &&
                        equalsIgnoreCase("Secure", buffer, nameStart, nameEnd)) {
                    lazyCookie.setSecure(true);
                    continue;
                }

                // HttpOnly
                if (!cookie.isHttpOnly() &&
                        CookieUtils.equals("HttpOnly", buffer, nameStart, nameEnd)) {
                    cookie.setHttpOnly(true);
                    continue;
                }

                if (CookieUtils.equals("Discard", buffer, nameStart, nameEnd)) {
                    continue;
                }
            }

            // Normal Cookie
            cookie = cookies.getNextUnusedCookie();
            if (!rfc6265Enabled && !cookie.isVersionSet()) {
                cookie.setVersion(0);
            }
            lazyCookie = cookie.getLazyCookieState();

            lazyCookie.getName().setBuffer(buffer, nameStart, nameEnd);

            if (valueStart != -1) { // Normal AVPair
                lazyCookie.getValue().setBuffer(buffer, valueStart, valueEnd);
                if (isQuoted) {
                    // We know this is a byte value so this is safe
                    unescapeDoubleQuotes(lazyCookie.getValue());
                }
            } else {
                // Name Only
                lazyCookie.getValue().setString("");
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.glassfish.grizzly.http.LazyCookieState

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.