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

Function http_server_session_sharing_cb

src/proxy/http/HttpConfig.cc:215–240  ·  view source on GitHub ↗

[amc] Not sure which is uglier, this switch or having a micro-function for each var. Oh, how I long for when we can use C++eleventy lambdas without compiler problems! I think for 5.0 when the BC stuff is yanked, we should probably revert this to independent callbacks.

Source from the content-addressed store, hash-verified

213// Oh, how I long for when we can use C++eleventy lambdas without compiler problems!
214// I think for 5.0 when the BC stuff is yanked, we should probably revert this to independent callbacks.
215static int
216http_server_session_sharing_cb(const char *name, RecDataT dtype, RecData data, void *cookie)
217{
218 bool valid_p = true;
219 HttpConfigParams *c = static_cast<HttpConfigParams *>(cookie);
220
221 if (0 == strcasecmp("proxy.config.http.server_session_sharing.match", name)) {
222 MgmtByte &match = c->oride.server_session_sharing_match;
223 if (RECD_INT == dtype) {
224 match = static_cast<TSServerSessionSharingMatchType>(data.rec_int);
225 } else if (RECD_STRING == dtype && HttpConfig::load_server_session_sharing_match(data.rec_string, match)) {
226 // empty
227 } else {
228 valid_p = false;
229 }
230 } else {
231 valid_p = false;
232 }
233
234 // Signal an update if valid value arrived.
235 if (valid_p) {
236 http_config_cb(name, dtype, data, cookie);
237 }
238
239 return REC_ERR_OKAY;
240}
241
242static int
243http_insert_forwarded_cb(const char *name, RecDataT dtype, RecData data, void *cookie)

Callers

nothing calls this directly

Calls 2

strcasecmpFunction · 0.85
http_config_cbFunction · 0.85

Tested by

no test coverage detected