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

Function optStrToBitset

src/proxy/http/ForwardedConfig.cc:123–187  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121namespace HttpForwarded
122{
123OptionBitSet
124optStrToBitset(std::string_view optConfigStr, swoc::FixedBufferWriter &error)
125{
126 const swoc::TextView Delimiters(":|");
127
128 OptionBitSet optBS;
129
130 // Convert to TS TextView to be able to use parsing members.
131 //
132 swoc::TextView oCS{optConfigStr};
133
134 if (eqIgnoreCaseWs(oCS, "none")) {
135 return OptionBitSet();
136 }
137
138 BadOptionsErrMsg em(error);
139
140 do {
141 swoc::TextView optStr = oCS.take_prefix_at(Delimiters);
142
143 if (eqIgnoreCaseWs(optStr, "for")) {
144 optBS.set(FOR);
145
146 } else if (eqIgnoreCaseWs(optStr, "by=ip")) {
147 optBS.set(BY_IP);
148
149 } else if (eqIgnoreCaseWs(optStr, "by=unknown")) {
150 optBS.set(BY_UNKNOWN);
151
152 } else if (eqIgnoreCaseWs(optStr, "by=servername")) {
153 optBS.set(BY_SERVER_NAME);
154
155 } else if (eqIgnoreCaseWs(optStr, "by=uuid")) {
156 optBS.set(BY_UUID);
157
158 } else if (eqIgnoreCaseWs(optStr, "proto")) {
159 optBS.set(PROTO);
160
161 } else if (eqIgnoreCaseWs(optStr, "host")) {
162 optBS.set(HOST);
163
164 } else if (eqIgnoreCaseWs(optStr, "connection=compact")) {
165 optBS.set(CONNECTION_COMPACT);
166
167 } else if (eqIgnoreCaseWs(optStr, "connection=std")) {
168 optBS.set(CONNECTION_STD);
169
170 } else if (eqIgnoreCaseWs(optStr, "connection=standard")) {
171 optBS.set(CONNECTION_STD);
172
173 } else if (eqIgnoreCaseWs(optStr, "connection=full")) {
174 optBS.set(CONNECTION_FULL);
175
176 } else {
177 em.add(optStr);
178 }
179 } while (oCS);
180

Callers 4

http_insert_forwarded_cbFunction · 0.85
startupMethod · 0.85
testFunction · 0.85
TSHttpTxnConfigStringSetFunction · 0.85

Calls 5

eqIgnoreCaseWsFunction · 0.85
take_prefix_atMethod · 0.80
setMethod · 0.45
addMethod · 0.45
doneMethod · 0.45

Tested by 1

testFunction · 0.68