File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -209,14 +209,16 @@ static unlang_action_t sql_trunk_query_start(UNUSED unlang_result_t *p_result,
209209static void sql_trunk_query_cancel (UNUSED request_t * request , UNUSED fr_signal_t action , void * uctx )
210210{
211211 fr_sql_query_t * query_ctx = talloc_get_type_abort (uctx , fr_sql_query_t );
212+ trunk_request_t * treq ;
212213
213214 if (!query_ctx -> treq ) return ;
215+ treq = query_ctx -> treq ;
214216
215217 /*
216218 * A reapable trunk request has already completed.
217219 */
218- if (unlikely (query_ctx -> treq -> state == TRUNK_REQUEST_STATE_REAPABLE )) {
219- trunk_request_signal_complete (query_ctx -> treq );
220+ if (unlikely (treq -> state == TRUNK_REQUEST_STATE_REAPABLE )) {
221+ trunk_request_signal_complete (treq );
220222 query_ctx -> treq = NULL ;
221223 return ;
222224 }
@@ -225,11 +227,10 @@ static void sql_trunk_query_cancel(UNUSED request_t *request, UNUSED fr_signal_t
225227 * The query_ctx needs to be parented by the treq so that it still exists
226228 * when the cancel_mux callback is run.
227229 */
228- if (query_ctx -> inst -> driver -> trunk_io_funcs .request_cancel_mux ) talloc_steal (query_ctx -> treq , query_ctx );
229-
230- trunk_request_signal_cancel (query_ctx -> treq );
231-
230+ if (query_ctx -> inst -> driver -> trunk_io_funcs .request_cancel_mux ) talloc_steal (treq , query_ctx );
232231 query_ctx -> treq = NULL ;
232+
233+ trunk_request_signal_cancel (treq );
233234}
234235
235236/** Submit an SQL query using a trunk connection.
You can’t perform that action at this time.
0 commit comments