MCPcopy Create free account
hub / github.com/azadkuh/qhttp / headerField

Method headerField

src/qhttpserverconnection.cpp:94–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

92}
93
94int
95QHttpConnectionPrivate::headerField(http_parser*, const char* at, size_t length) {
96 if ( ilastRequest == nullptr )
97 return 0;
98
99 // insert the header we parsed previously
100 // into the header map
101 if ( !itempHeaderField.isEmpty() && !itempHeaderValue.isEmpty() ) {
102 // header names are always lower-cased
103 ilastRequest->d_func()->iheaders.insert(
104 itempHeaderField.toLower(),
105 itempHeaderValue.toLower()
106 );
107 // clear header value. this sets up a nice
108 // feedback loop where the next time
109 // HeaderValue is called, it can simply append
110 itempHeaderField.clear();
111 itempHeaderValue.clear();
112 }
113
114 itempHeaderField.append(at, length);
115 return 0;
116}
117
118int
119QHttpConnectionPrivate::headerValue(http_parser*, const char* at, size_t length) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected