Browse code

dispatcher: update state if sending keepalive OPTIONS fails

- backport of 4584e17b98f338916cc89dac6e1700f250cdf501

Daniel-Constantin Mierla authored on 14/09/2020 07:33:16
Showing 1 changed files
... ...
@@ -3252,6 +3252,7 @@ void ds_ping_set(ds_set_t *node)
3252 3252
 	uac_req_t uac_r;
3253 3253
 	int i, j;
3254 3254
 	str ping_from;
3255
+	int state;
3255 3256
 
3256 3257
 	if(!node)
3257 3258
 		return;
... ...
@@ -3300,6 +3301,18 @@ void ds_ping_set(ds_set_t *node)
3300 3301
 					< 0) {
3301 3302
 				LM_ERR("unable to ping [%.*s]\n", node->dlist[j].uri.len,
3302 3303
 						node->dlist[j].uri.s);
3304
+				state = DS_TRYING_DST;
3305
+				if(ds_probing_mode != DS_PROBE_NONE) {
3306
+					state |= DS_PROBING_DST;
3307
+				}
3308
+				/* check if meantime someone disabled the target via RPC */
3309
+				if(!(node->dlist[j].flags & DS_DISABLED_DST)
3310
+						&& ds_update_state(NULL, node->id, &node->dlist[j].uri,
3311
+								state) != 0) {
3312
+					LM_ERR("Setting the probing state failed (%.*s, group %d)\n",
3313
+							node->dlist[j].uri.len, node->dlist[j].uri.s,
3314
+							node->id);
3315
+				}
3303 3316
 			}
3304 3317
 		}
3305 3318
 	}