// no more cookie headers headers
if (pos < 0) {
break;
}
DataChunk cookieValue = headers.getValue(pos);
if (cookieValue == null || cookieValue.isNull()) {
pos++;
continue;
}
// Uncomment to test the new parsing code
if (cookieValue.getType() == DataChunk.Type.Bytes) {
if (logger.isLoggable(Level.FINE)) {
log("Parsing b[]: " + cookieValue.toString());
}
final ByteChunk byteChunk = cookieValue.getByteChunk();
CookieParserUtils.parseServerCookies(this, byteChunk.getBuffer(),
byteChunk.getStart(),
byteChunk.getLength(),
CookieUtils.COOKIE_VERSION_ONE_STRICT_COMPLIANCE,
CookieUtils.RFC_6265_SUPPORT_ENABLED);
} else if (cookieValue.getType() == DataChunk.Type.Buffer) {
if (logger.isLoggable(Level.FINE)) {
log("Parsing b[]: " + cookieValue.toString());
}
final BufferChunk bufferChunk = cookieValue.getBufferChunk();
CookieParserUtils.parseServerCookies(this, bufferChunk.getBuffer(),
bufferChunk.getStart(),
bufferChunk.getLength(),
CookieUtils.COOKIE_VERSION_ONE_STRICT_COMPLIANCE,
CookieUtils.RFC_6265_SUPPORT_ENABLED);
} else {
if (logger.isLoggable(Level.FINE)) {
log("Parsing string: " + cookieValue.toString());
}
final String value = cookieValue.toString();
CookieParserUtils.parseServerCookies(this, value,
CookieUtils.COOKIE_VERSION_ONE_STRICT_COMPLIANCE,
CookieUtils.RFC_6265_SUPPORT_ENABLED);
}