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

Method set_body

src/iocore/net/OCSPStapling.cc:332–351  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

330 }
331
332 int
333 set_body(const char *content_type, const ASN1_ITEM *it, const ASN1_VALUE *req)
334 {
335 this->_req_body = nullptr;
336
337 if (req != nullptr) {
338 // const_cast is needed for OpenSSL 1.1.1
339 this->_req_body_len = ASN1_item_i2d(const_cast<ASN1_VALUE *>(req), &this->_req_body, it);
340 if (this->_req_body_len == -1) {
341 return 0;
342 }
343 }
344 this->add_header("Content-Type", content_type);
345 char req_body_len_str[10];
346 int req_body_len_str_len;
347 req_body_len_str_len = ink_fast_itoa(this->_req_body_len, req_body_len_str, sizeof(req_body_len_str));
348 this->add_header("Content-Length", 14, req_body_len_str, req_body_len_str_len);
349
350 return 1;
351 }
352
353 void
354 add_header(const char *name, int name_len, const char *value, int value_len)

Callers 1

query_responderFunction · 0.80

Calls 2

add_headerMethod · 0.95
ink_fast_itoaFunction · 0.85

Tested by

no test coverage detected