public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final byte[] protocolBytes, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBytes, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBytes, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBytes, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBytes, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + new String(protocolBytes, offset, len, Charsets.ASCII_CHARSET)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
public static Protocol valueOf(final Buffer protocolBuffer, final int offset, final int len) { if (len == 0) { return Protocol.HTTP_0_9; } else if (equals(HTTP_1_1, protocolBuffer, offset, len)) { return Protocol.HTTP_1_1; } else if (equals(HTTP_1_0, protocolBuffer, offset, len)) { return Protocol.HTTP_1_0; } else if (equals(HTTP_2_0, protocolBuffer, offset, len)) { return Protocol.HTTP_2_0; } else if (equals(HTTP_0_9, protocolBuffer, offset, len)) { return Protocol.HTTP_0_9; } throw new IllegalStateException("Unknown protocol " + protocolBuffer.toStringContent(Charsets.ASCII_CHARSET, offset, len)); }
private void setKeepAliveForHeader(final Header header, final HttpRequestPacket requestPacket) { final MimeHeaders headers = requestPacket.getHeaders(); // Assign Connection: ... if needed if (!headers.contains(header)) { if (requestPacket.getProcessingState().isKeepAlive()) { headers.addValue(header).setBytes(KEEP_ALIVE_VALUE.getByteArray()); } else if (Protocol.HTTP_1_1.equals(requestPacket.getProtocol())) { headers.addValue(header).setBytes(CLOSE_VALUE.getByteArray()); } // switch (requestPacket.getProtocol()) { // case HTTP_0_9: // case HTTP_1_0: // if (requestPacket.getProcessingState().isKeepAlive()) { // headers.addValue(header).setBytes(KEEP_ALIVE_VALUE.getByteArray()); // } // break; // case HTTP_1_1: // if (!requestPacket.getProcessingState().isKeepAlive()) { // headers.addValue(header).setBytes(CLOSE_VALUE.getByteArray()); // } // break; // } } }