From a32ff3fd98ea73e8a50c76f38fa304cd03ceb13d Mon Sep 17 00:00:00 2001 From: rd235 Date: Sat, 15 Jan 2011 17:39:43 +0000 Subject: [PATCH] libvdehist: reload the command list when plugins get loaded/unloaded git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@461 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/src/lib/libvdehist.c | 8 ++++++++ vde-2/src/vde_switch/plugins/iplog.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/vde-2/src/lib/libvdehist.c b/vde-2/src/lib/libvdehist.c index ff3c488..686e04a 100644 --- a/vde-2/src/lib/libvdehist.c +++ b/vde-2/src/lib/libvdehist.c @@ -323,6 +323,8 @@ void vdehist_mgmt_to_term(struct vdehiststat *st) n=vdehist_vderead(st->mgmtfd,buf,BUFSIZE); } } + if (commandlist == NULL && st->mgmtfd >= 0) + vdehist_create_commandlist(st->mgmtfd); /* redraw the input line */ redraw_line(st,1); } @@ -350,6 +352,12 @@ static int hist_sendcmd(struct vdehiststat *st) vdehist_termwrite(st->termfd,"\r\n",2); vdehist_termwrite(st->termfd,prompt,strlen(prompt)); } + if (commandlist != NULL && + (strncmp(cmd,"plugin/add",10) == 0 || + strncmp(cmd,"plugin/del",10) == 0)) { + free(commandlist); + commandlist=NULL; + } return 0; } diff --git a/vde-2/src/vde_switch/plugins/iplog.c b/vde-2/src/vde_switch/plugins/iplog.c index 2671c5f..9e564c6 100644 --- a/vde-2/src/vde_switch/plugins/iplog.c +++ b/vde-2/src/vde_switch/plugins/iplog.c @@ -343,7 +343,7 @@ static int iplog_port_minus(struct dbgcl *event,void *arg,va_list v) /*user interface: showinfo */ static int ipshowinfo(FILE *fd) { - printoutc(fd,"iplog: ip/port/user loggin plugin"); + printoutc(fd,"iplog: ip/port/user logging plugin"); if (logfilefd<0) { if (logfilefd == -1) printoutc(fd,"log disabled"); -- 2.11.4.GIT