Lines Matching defs:qstate

65 on_mp_read_session_destroy(struct query_state *qstate)
68 finalize_comm_element(&qstate->request);
69 finalize_comm_element(&qstate->response);
71 if (qstate->mdata != NULL) {
72 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
74 (cache_mp_read_session)qstate->mdata);
75 configuration_unlock_entry(qstate->config_entry,
90 on_mp_read_session_request_read1(struct query_state *qstate)
96 if (qstate->kevent_watermark == 0)
97 qstate->kevent_watermark = sizeof(size_t);
99 init_comm_element(&qstate->request,
102 &qstate->request);
104 result = qstate->read_func(qstate,
121 qstate->kevent_watermark = c_mp_rs_request->entry_length;
122 qstate->process_func = on_mp_read_session_request_read2;
129 on_mp_read_session_request_read2(struct query_state *qstate)
135 c_mp_rs_request = get_cache_mp_read_session_request(&qstate->request);
137 result = qstate->read_func(qstate, c_mp_rs_request->entry,
140 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
147 qstate->kevent_watermark = 0;
148 qstate->process_func = on_mp_read_session_request_process;
154 on_mp_read_session_request_process(struct query_state *qstate)
171 init_comm_element(&qstate->response, CET_MP_READ_SESSION_RESPONSE);
173 &qstate->response);
174 c_mp_rs_request = get_cache_mp_read_session_request(&qstate->request);
176 qstate->config_entry = configuration_find_entry(
178 if (qstate->config_entry == NULL) {
187 if (qstate->config_entry->enabled == 0) {
196 if (qstate->config_entry->perform_actual_lookups != 0)
198 qstate->config_entry->mp_cache_params.cep.entry_name);
201 if (check_query_eids(qstate) != 0) {
207 asprintf(&dec_cache_entry_name, "%s%s", qstate->eid_str,
208 qstate->config_entry->mp_cache_params.cep.entry_name);
218 (qstate->config_entry->perform_actual_lookups != 0))
219 c_entry = register_new_mp_cache_entry(qstate,
225 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
227 configuration_unlock_entry(qstate->config_entry,
231 (qstate->config_entry->perform_actual_lookups != 0)) {
245 configuration_lock_entry(qstate->config_entry,
248 configuration_unlock_entry(qstate->config_entry,
260 qstate->config_entry,
268 qstate->config_entry,
275 qstate->config_entry,
279 qstate->config_entry,
289 configuration_lock_entry(qstate->config_entry,
292 configuration_unlock_entry(qstate->config_entry,
300 qstate->mdata = rs;
301 qstate->destroy_func = on_mp_read_session_destroy;
303 configuration_lock_entry(qstate->config_entry,
305 if ((qstate->config_entry->mp_query_timeout.tv_sec != 0) ||
306 (qstate->config_entry->mp_query_timeout.tv_usec != 0))
307 memcpy(&qstate->timeout,
308 &qstate->config_entry->mp_query_timeout,
310 configuration_unlock_entry(qstate->config_entry,
317 qstate->process_func = on_mp_read_session_response_write1;
318 qstate->kevent_watermark = sizeof(int);
319 qstate->kevent_filter = EVFILT_WRITE;
326 on_mp_read_session_response_write1(struct query_state *qstate)
333 &qstate->response);
334 result = qstate->write_func(qstate, &c_mp_rs_response->error_code,
345 qstate->kevent_watermark = sizeof(int);
346 qstate->process_func = on_mp_read_session_mapper;
347 qstate->kevent_filter = EVFILT_READ;
349 qstate->kevent_watermark = 0;
350 qstate->process_func = NULL;
362 on_mp_read_session_mapper(struct query_state *qstate)
368 if (qstate->kevent_watermark == 0) {
369 qstate->kevent_watermark = sizeof(int);
371 result = qstate->read_func(qstate, &elem_type, sizeof(int));
381 qstate->kevent_watermark = 0;
382 qstate->process_func =
386 qstate->kevent_watermark = 0;
387 qstate->process_func =
391 qstate->kevent_watermark = 0;
392 qstate->process_func = NULL;
413 on_mp_read_session_read_request_process(struct query_state *qstate)
418 init_comm_element(&qstate->response, CET_MP_READ_SESSION_READ_RESPONSE);
420 &qstate->response);
422 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
424 (cache_mp_read_session)qstate->mdata, NULL,
431 (cache_mp_read_session)qstate->mdata,
435 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
438 qstate->kevent_watermark = sizeof(size_t) + sizeof(int);
440 qstate->kevent_watermark = sizeof(int);
441 qstate->process_func = on_mp_read_session_read_response_write1;
442 qstate->kevent_filter = EVFILT_WRITE;
449 on_mp_read_session_read_response_write1(struct query_state *qstate)
456 &qstate->response);
458 result = qstate->write_func(qstate, &read_response->error_code,
461 result += qstate->write_func(qstate, &read_response->data_size,
463 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
470 qstate->kevent_watermark = read_response->data_size;
471 qstate->process_func = on_mp_read_session_read_response_write2;
473 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
480 qstate->kevent_watermark = 0;
481 qstate->process_func = NULL;
489 on_mp_read_session_read_response_write2(struct query_state *qstate)
496 &qstate->response);
497 result = qstate->write_func(qstate, read_response->data,
499 if (result < 0 || (size_t)result != qstate->kevent_watermark) {
506 finalize_comm_element(&qstate->request);
507 finalize_comm_element(&qstate->response);
509 qstate->kevent_watermark = sizeof(int);
510 qstate->process_func = on_mp_read_session_mapper;
511 qstate->kevent_filter = EVFILT_READ;
522 on_mp_read_session_close_notification(struct query_state *qstate)
526 configuration_lock_entry(qstate->config_entry, CELT_MULTIPART);
527 close_cache_mp_read_session((cache_mp_read_session)qstate->mdata);
528 configuration_unlock_entry(qstate->config_entry, CELT_MULTIPART);
529 qstate->mdata = NULL;
530 qstate->kevent_watermark = 0;
531 qstate->process_func = NULL;