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

Function WriteResponseHeader

plugins/generator/generator.cc:295–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

293}
294
295static TSReturnCode
296WriteResponseHeader(GeneratorHttpHeader &response, TSHttpStatus status)
297{
298 if (TSHttpHdrTypeSet(response.buffer, response.header, TS_HTTP_TYPE_RESPONSE) != TS_SUCCESS) {
299 VERROR("failed to set type");
300 return TS_ERROR;
301 }
302 if (TSHttpHdrVersionSet(response.buffer, response.header, TS_HTTP_VERSION(1, 1)) != TS_SUCCESS) {
303 VERROR("failed to set HTTP version");
304 return TS_ERROR;
305 }
306 if (TSHttpHdrStatusSet(response.buffer, response.header, status) != TS_SUCCESS) {
307 VERROR("failed to set HTTP status");
308 return TS_ERROR;
309 }
310
311 if (TSHttpHdrReasonSet(response.buffer, response.header, TSHttpHdrReasonLookup(status), -1) != TS_SUCCESS) {
312 VERROR("failed to set expand HTTP status");
313 return TS_ERROR;
314 };
315
316 return TS_SUCCESS;
317}
318
319static TSReturnCode
320GeneratorWriteFailureResponse(GeneratorRequest *grq, TSHttpStatus status)

Callers 3

GeneratorWriteResponseFunction · 0.70
GeneratorPOSTResponseFunction · 0.70

Calls 5

TSHttpHdrTypeSetFunction · 0.85
TSHttpHdrVersionSetFunction · 0.85
TSHttpHdrStatusSetFunction · 0.85
TSHttpHdrReasonSetFunction · 0.85
TSHttpHdrReasonLookupFunction · 0.85

Tested by

no test coverage detected