summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>2020-01-09 11:51:37 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2020-07-06 10:04:07 +0900
commite63ea67522ec24e08d2b401a31424e021ace7dff (patch)
tree843c1327318bd4e8745558488afa809771408601
parent5e6cc588369c94697754db79cc00083976ab6f30 (diff)
downloadDLT-daemon-e63ea67522ec24e08d2b401a31424e021ace7dff.tar.gz
daemon: logstorage with wildcards
In the current implementation, if FILTER section is setting wildcard for both "LogAppName" and "ContextName", it will be ignored. But it is still a valid configuration for NON-VERBOSE. In order to consolidate the daemon's behavior, the combination of wildcard for both "LogAppName" and "ContextName" in FILTER section will be treated as only ECUID is specified. Signed-off-by: Bui Nguyen Quoc Thanh <Thanh.BuiNguyenQuoc@vn.bosch.com>
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c
index b98e4ee..948fbee 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage.c
@@ -605,8 +605,9 @@ DLT_STATIC void dlt_logstorage_create_keys_only_ecu(char *ecuid, char *key)
* - a comma separated list of ids
* - a wildcard: .*
*
- * Not allowed is the combination of application id and context id set to
- * wildcard. This will be rejected.
+ * If both application and context id are set to wildcard, this will be treated
+ * in the same way of the case application and context id are not present:
+ * - EcuID must be specified
*
* If lists given for application and/or context id, all possible combinations
* are returned as keys in a form "[apid][ctid], e.g. "APP1\:CTX1".
@@ -637,7 +638,8 @@ DLT_STATIC int dlt_logstorage_create_keys(char *apids,
int num_currkey = 0;
/* Handle ecuid alone case here */
- if ((apids == NULL) && (ctids == NULL) && (ecuid != NULL)) {
+ if (((apids == NULL) && (ctids == NULL) && (ecuid != NULL)) ||
+ ((strncmp(apids, ".*", 2) == 0) && (strncmp(ctids, ".*", 2) == 0) && (ecuid != NULL)) ) {
dlt_logstorage_create_keys_only_ecu(ecuid, curr_key);
*(num_keys) = 1;
*(keys) = (char *)calloc(*num_keys * DLT_OFFLINE_LOGSTORAGE_MAX_KEY_LEN,
@@ -1542,7 +1544,7 @@ DLT_STATIC int dlt_logstorage_store_filters(DltLogStorage *handle,
* key consists of none wildcard value, e.g. apid=.*, cxid=CTX1
* results in "CTX1".
*
- * Combination of two wildcards is not allowed.
+ * Combination of two wildcards is not allowed if ECUID is not specified.
*
* @param handle DLT Logstorage handle
* @return 0 on success, -1 on error, 1 on warning