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

Function PluginHttpConnectInternal

src/proxy/PluginHttpConnect.cc:35–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33}
34
35PluginVC *
36PluginHttpConnectInternal(TSHttpConnectOptions *options)
37{
38 if (options->buffer_index < TS_IOBUFFER_SIZE_INDEX_128 || options->buffer_index > MAX_BUFFER_SIZE_INDEX) {
39 options->buffer_index = TS_IOBUFFER_SIZE_INDEX_32K; // out of range, set to the default for safety
40 }
41
42 if (options->buffer_water_mark < TS_IOBUFFER_WATER_MARK_PLUGIN_VC_DEFAULT) {
43 options->buffer_water_mark = TS_IOBUFFER_WATER_MARK_PLUGIN_VC_DEFAULT;
44 }
45
46 if (plugin_http_accept) {
47 PluginVCCore *new_pvc = PluginVCCore::alloc(plugin_http_accept, options->buffer_index, options->buffer_water_mark);
48
49 new_pvc->set_active_addr(options->addr);
50 new_pvc->set_plugin_id(options->id);
51 new_pvc->set_plugin_tag(options->tag);
52
53 PluginVC *return_vc = new_pvc->connect();
54
55 if (return_vc != nullptr) {
56 PluginVC *other_side = return_vc->get_other_side();
57
58 if (other_side != nullptr) {
59 other_side->set_is_internal_request(true);
60 }
61 }
62
63 return return_vc;
64 }
65
66 return nullptr;
67}

Callers 2

httpConnectMethod · 0.85
TSHttpConnectPluginFunction · 0.85

Calls 6

set_active_addrMethod · 0.80
set_plugin_idMethod · 0.80
set_plugin_tagMethod · 0.80
get_other_sideMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected