示例#1
0
 private void writeScheme(final ByteBuf buf, final AsciiString scheme) {
   if (scheme.equals(SCHEME_HTTP)) {
     Hpack.writeIndexedHeaderField(buf, 6);
   } else if (scheme.equals(SCHEME_HTTPS)) {
     Hpack.writeIndexedHeaderField(buf, 7);
   } else {
     writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 2);
     writeString(buf, scheme);
   }
 }
示例#2
0
 private void writePath(final ByteBuf buf, final AsciiString path) {
   if (path.equals(PATH_SLASH)) {
     Hpack.writeIndexedHeaderField(buf, 4);
   } else if (path.equals(PATH_INDEX_HTML)) {
     Hpack.writeIndexedHeaderField(buf, 5);
   } else {
     writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 4);
     writeString(buf, path);
   }
 }
示例#3
0
 private void writeMethod(final ByteBuf buf, final AsciiString method) {
   if (method.equals(HttpMethod.GET.asciiName())) {
     Hpack.writeIndexedHeaderField(buf, 2);
   } else if (method.equals(HttpMethod.POST.asciiName())) {
     Hpack.writeIndexedHeaderField(buf, 3);
   } else {
     writeLiteralHeaderFieldIncrementalIndexingIndexedName(buf, 2);
     writeString(buf, method);
   }
 }