Browse code

dispatcher: update state if sending keepalive OPTIONS fails

- backport of 4584e17b98f338916cc89dac6e1700f250cdf501

(cherry picked from commit 1bccb817c20f02665d48a38eb59a57a6ae17b81f)

Daniel-Constantin Mierla authored on 14/09/2020 07:33:16
Showing 1 changed files
... ...
@@ -3095,6 +3095,7 @@ void ds_ping_set(ds_set_t *node)
3095 3095
 	uac_req_t uac_r;
3096 3096
 	int i, j;
3097 3097
 	str ping_from;
3098
+	int state;
3098 3099
 
3099 3100
 	if(!node)
3100 3101
 		return;
... ...
@@ -3144,6 +3145,18 @@ void ds_ping_set(ds_set_t *node)
3144 3145
 					< 0) {
3145 3146
 				LM_ERR("unable to ping [%.*s]\n", node->dlist[j].uri.len,
3146 3147
 						node->dlist[j].uri.s);
3148
+				state = DS_TRYING_DST;
3149
+				if(ds_probing_mode != DS_PROBE_NONE) {
3150
+					state |= DS_PROBING_DST;
3151
+				}
3152
+				/* check if meantime someone disabled the target via RPC */
3153
+				if(!(node->dlist[j].flags & DS_DISABLED_DST)
3154
+						&& ds_update_state(NULL, node->id, &node->dlist[j].uri,
3155
+								state) != 0) {
3156
+					LM_ERR("Setting the probing state failed (%.*s, group %d)\n",
3157
+							node->dlist[j].uri.len, node->dlist[j].uri.s,
3158
+							node->id);
3159
+				}
3147 3160
 			}
3148 3161
 		}
3149 3162
 	}