MCPcopy Create free account
hub / github.com/MonaSolutions/MonaServer / ParseConnection

Method ParseConnection

MonaCore/sources/HTTP/HTTP.cpp:219–236  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

217}
218
219UInt8 HTTP::ParseConnection(Exception& ex,const char* value) {
220 UInt8 type(CONNECTION_ABSENT);
221 String::ForEach forEach([&type,&ex](UInt32 index,const char* field){
222 if (String::ICompare(field, "upgrade") == 0)
223 type |= CONNECTION_UPGRADE;
224 else if (String::ICompare(field, "keep-alive") == 0)
225 type |= CONNECTION_KEEPALIVE;
226 else if (String::ICompare(field, "close") == 0)
227 type |= CONNECTION_CLOSE;
228 else if (String::ICompare(field, "update") == 0)
229 type |= CONNECTION_UPDATE;
230 else
231 ex.set(Exception::PROTOCOL, "Unknown HTTP type connection ", field);
232 return true;
233 });
234 String::Split(value, ",", forEach, String::SPLIT_IGNORE_EMPTY | String::SPLIT_TRIM);
235 return type;
236}
237
238
239HTTP::ContentType HTTP::ParseContentType(const char* value, string& subType) {

Callers

nothing calls this directly

Calls 1

setMethod · 0.45

Tested by

no test coverage detected