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

Function cont_data_alloc

example/plugins/c-api/thread_pool/psi.cc:122–145  ·  view source on GitHub ↗

------------------------------------------------------------------------- cont_data_alloc Allocate and initialize a ContData structure associated to a transaction Input: Output: Return Value: Pointer on a new allocated ContData structure -------------------------------------------------------------------------*/

Source from the content-addressed store, hash-verified

120 Pointer on a new allocated ContData structure
121 -------------------------------------------------------------------------*/
122static ContData *
123cont_data_alloc()
124{
125 ContData *data;
126
127 data = static_cast<ContData *>(TSmalloc(sizeof(ContData)));
128 data->magic = MAGIC_ALIVE;
129 data->output_vio = nullptr;
130 data->output_buffer = nullptr;
131 data->output_reader = nullptr;
132
133 data->psi_buffer = nullptr;
134 data->psi_reader = nullptr;
135 data->psi_filename[0] = '\0';
136 data->psi_filename_len = 0;
137 data->psi_success = 0;
138
139 data->parse_state = PARSE_SEARCH;
140
141 data->state = STATE_READ_DATA;
142 data->transform_bytes = 0;
143
144 return data;
145}
146
147/*-------------------------------------------------------------------------
148 cont_data_destroy

Callers 1

transform_addFunction · 0.85

Calls 1

TSmallocFunction · 0.85

Tested by

no test coverage detected