case RLM_MODULE_OK: /* found */
break;
+ case RLM_MODULE_NOTFOUND: /* !found is "no data" */
+ talloc_free(target);
+ cache_release(inst, request, &handle);
+ return XLAT_ACTION_DONE;
+
default:
talloc_free(target);
cache_release(inst, request, &handle);
cache_release(inst, request, &handle);
/*
- * Check if we found a matching map
+ * If we found a value, then the output has been updated.
+ * Otherwise, there is no output. Either way, the xlat succeeded.
*/
- if (!map) return XLAT_ACTION_FAIL;
return XLAT_ACTION_DONE;
}
# Regression test for deadlock on notfound
Filter-Id := 'testkey0'
+#
+# There is no request.Login-LAT-Port, so the input is empty.
+#
Login-LAT-Node := %cache(request.Login-LAT-Port)
# Would previously deadlock
Login-LAT-Port := %cache(request.Login-LAT-Port)
+#
+# Get the value for a key which doesn't exist. The xlat should succeed, but return no data.
+#
+Filter-Id := 'nosuchkey'
+request.Login-LAT-Service := %cache('request.Callback-Id')
+if request.Login-LAT-Service {
+ test_fail
+}
+
+#
+# And then verify that the previous cache entry hasn't been deleted
+#
+Filter-Id := 'testkey'
+request.Login-LAT-Service := %cache('request.Callback-Id')
+
+if (Login-LAT-Service != control.Callback-Id) {
+ test_fail
+}
+
test_pass