Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2011-11-16 06:05:47 +0000
committerEugene Tarassov2011-11-16 21:43:29 +0000
commit21ca34118a99441cf068035a9e4eb54f7377d95d (patch)
tree46af25324d810c0117ed2ce094fb47cf1f8b0699
parentc6537826abff270dfa1df4eade5d4d74840b57d9 (diff)
downloadorg.eclipse.tcf.agent-21ca34118a99441cf068035a9e4eb54f7377d95d.tar.gz
org.eclipse.tcf.agent-21ca34118a99441cf068035a9e4eb54f7377d95d.tar.xz
org.eclipse.tcf.agent-21ca34118a99441cf068035a9e4eb54f7377d95d.zip
TCF Agent: PathMap.get command changed to return all mapping rules, including rules created by other clients.
-rw-r--r--services/pathmap.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/services/pathmap.c b/services/pathmap.c
index 9ae62c96..e26c7232 100644
--- a/services/pathmap.c
+++ b/services/pathmap.c
@@ -459,27 +459,27 @@ void set_path_map(Channel * c, InputStream * inp) {
}
static void command_get(char * token, Channel * c) {
- PathMap * m = (PathMap *)find_map(c);
+ unsigned n = 0;
+ LINK * l = maps.next;
if (read_stream(&c->inp) != MARKER_EOM) exception(ERR_JSON_SYNTAX);
write_stringz(&c->out, "R");
write_stringz(&c->out, token);
write_errno(&c->out, 0);
- if (m == NULL) {
- write_stringz(&c->out, "null");
- }
- else {
+ write_stream(&c->out, '[');
+ while (l != &maps) {
unsigned i;
- write_stream(&c->out, '[');
+ PathMap * m = maps2map(l);
for (i = 0; i < m->rules_cnt; i++) {
PathMapRule * r = m->rules + i;
- if (i > 0) write_stream(&c->out, ',');
+ if (n++ > 0) write_stream(&c->out, ',');
write_rule(&c->out, r);
}
- write_stream(&c->out, ']');
- write_stream(&c->out, 0);
+ l = l->next;
}
+ write_stream(&c->out, ']');
+ write_stream(&c->out, 0);
write_stream(&c->out, MARKER_EOM);
}
@@ -503,6 +503,7 @@ static void channel_close_listener(Channel * c) {
m = find_map(c);
if (m == NULL) return;
list_remove(&m->maps);
+ if (m->rules_cnt > 0) path_map_event_mapping_changed(c);
for (i = 0; i < m->rules_cnt; i++) free_rule(m->rules + i);
loc_free(m->rules);
loc_free(m);

Back to the top