MCPcopy Create free account
hub / github.com/apache/trafficserver / getHttpVersion

Method getHttpVersion

src/tscpp/api/utils_internal.cc:312–332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312HttpVersion
313utils::internal::getHttpVersion(TSMBuffer hdr_buf, TSMLoc hdr_loc)
314{
315 int version = TSHttpHdrVersionGet(hdr_buf, hdr_loc);
316 if (version != TS_ERROR) {
317 if ((TS_HTTP_MAJOR(version) == 0) && (TS_HTTP_MINOR(version) == 0)) {
318 return HTTP_VERSION_0_9;
319 }
320 if ((TS_HTTP_MAJOR(version) == 1) && (TS_HTTP_MINOR(version) == 0)) {
321 return HTTP_VERSION_1_0;
322 }
323 if ((TS_HTTP_MAJOR(version) == 1) && (TS_HTTP_MINOR(version) == 1)) {
324 return HTTP_VERSION_1_1;
325 } else {
326 LOG_ERROR("Unrecognized version %d", version);
327 }
328 } else {
329 LOG_ERROR("Could not get version; hdr_buf %p, hdr_loc %p", hdr_buf, hdr_loc);
330 }
331 return HTTP_VERSION_UNKNOWN;
332}
333
334void
335utils::internal::initTransactionManagement()

Callers

nothing calls this directly

Calls 1

TSHttpHdrVersionGetFunction · 0.85

Tested by

no test coverage detected