return 1;
}
+void pcli_write_prompt(struct stream *s)
+{
+ struct buffer *msg = get_trash_chunk();
+ struct channel *oc = si_oc(&s->si[0]);
+
+ if (s->pcli_next_pid == 0)
+ chunk_appendf(msg, "master> ");
+ else
+ chunk_appendf(msg, "%d> ", s->pcli_next_pid);
+ co_inject(oc, msg->area, msg->data);
+}
+
/* The pcli_* functions are used for the CLI proxy in the master */
command for this session */
if (target_pid > -1) {
s->pcli_next_pid = target_pid;
- // TODO: pcli_reply the prompt
+ pcli_write_prompt(s);
} else {
// TODO: pcli_reply() error
s->pcli_next_pid = 0;
if ((rep->flags & (CF_SHUTR|CF_READ_NULL))) {
/* stream cleanup */
+ pcli_write_prompt(s);
+
s->si[1].flags |= SI_FL_NOLINGER | SI_FL_NOHALF;
si_shutr(&s->si[1]);
si_shutw(&s->si[1]);