shorten name mangling on rsp

This commit is contained in:
Ron Pedde 2006-05-27 10:37:46 +00:00
parent b03942bfba
commit 0285f0bdc0
2 changed files with 9 additions and 2 deletions

View File

@ -406,6 +406,8 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) {
PLUGIN_REND_INFO *pri;
char *supplied_txt;
char *new_name;
char *ver;
char *slash;
int name_len;
@ -431,7 +433,12 @@ int plugin_rend_register(char *name, int port, char *iface, char *txt) {
memset(new_name,0,name_len);
if(conf_get_int("plugins","mangle_rendezvous",1)) {
snprintf(new_name,name_len,"%s (%s)",name,ppi->versionstring);
ver = strdup(ppi->versionstring);
if(strchr(ver,'/')) {
*strchr(ver,'/') = '\0';
}
snprintf(new_name,name_len,"%s (%s)",name,ver);
free(ver);
} else {
snprintf(new_name,name_len,"%s",name);
}

View File

@ -42,7 +42,7 @@ PLUGIN_REND_INFO _pri[] = {
PLUGIN_INFO _pi = {
PLUGIN_VERSION, /* version */
PLUGIN_OUTPUT, /* type */
"rsp/" RSP_VERSION, /* server */
"rsp/" VERSION, /* server */
"/rsp/.*", /* url */
&_pofn, /* output fns */
NULL, /* event fns */