MCPcopy Index your code
hub / github.com/apache/tomcat / emitHeader

Method emitHeader

java/org/apache/coyote/http2/HpackDecoder.java:440–463  ·  view source on GitHub ↗
(String name, String value)

Source from the content-addressed store, hash-verified

438
439
440 private void emitHeader(String name, String value) throws HpackException {
441 // Header names are forced to lower case
442 if ("cookie".equals(name)) {
443 // Only count the cookie header once since HTTP/2 splits it into
444 // multiple headers to aid compression
445 if (!countedCookie) {
446 headerCount++;
447 countedCookie = true;
448 }
449 } else {
450 headerCount++;
451 }
452 // Overhead will vary. The main concern is that lots of small headers
453 // trigger the limiting mechanism correctly. Therefore, use an overhead
454 // estimate of 3 which is the worst case for small headers.
455 int inc = 3 + name.length() + value.length();
456 headerSize += inc;
457 if (!isHeaderCountExceeded() && !isHeaderSizeExceeded(0)) {
458 if (log.isTraceEnabled()) {
459 log.trace(sm.getString("hpackdecoder.emitHeader", name, value));
460 }
461 headerEmitter.emitHeader(name, value);
462 }
463 }
464
465
466 boolean isHeaderCountExceeded() {

Callers 3

decodeMethod · 0.95
handleIndexMethod · 0.95
addStaticTableEntryMethod · 0.95

Calls 8

isHeaderCountExceededMethod · 0.95
isHeaderSizeExceededMethod · 0.95
lengthMethod · 0.80
equalsMethod · 0.65
isTraceEnabledMethod · 0.65
traceMethod · 0.65
getStringMethod · 0.65
emitHeaderMethod · 0.65

Tested by

no test coverage detected