bool parseImpl(HTTP2Codec& codec, std::function<void(IOBuf*)> hackIngress) { auto ingress = output_.move(); if (hackIngress) { hackIngress(ingress.get()); } size_t parsed = codec.onIngress(*ingress); return (parsed == ingress->computeChainDataLength()); }
/* * hackIngress is used to keep the codec's strict checks while having * separate checks for tests */ bool parseImpl(HTTP2Codec& codec, std::function<void(IOBuf*)> hackIngress) { dumpToFile(codec.getTransportDirection() == TransportDirection::UPSTREAM); auto ingress = output_.move(); if (hackIngress) { hackIngress(ingress.get()); } size_t parsed = codec.onIngress(*ingress); return (parsed == ingress->computeChainDataLength()); }