free(fn->name);
if(fn->sk != NULL)
putsock(fn->sk);
+ if(fn->owner != NULL)
+ free(fn->owner);
free(fn);
numfnetnodes--;
}
return(fnet);
}
-struct fnetnode *fnetinitconnect(wchar_t *name, char *addr, struct wcspair *args)
+struct fnetnode *fnetinitconnect(wchar_t *name, wchar_t *owner, char *addr, struct wcspair *args)
{
struct fnet *fnet;
struct fnetnode *fn;
return(NULL);
}
fn = newfn(fnet);
+ fn->owner = swcsdup(owner);
fn->pubid = icmbstowcs(addr, NULL);
if(fn->pubid == NULL)
fn->pubid = swcsdup(L"");
time_t srchwait, lastsrch;
wchar_t *name, *pubid;
wchar_t *mynick;
+ wchar_t *owner;
struct fnet *fnet;
struct socket *sk;
struct fnetpeerdatum *peerdata;
void fnetsetstate(struct fnetnode *fn, int newstate);
int fnetsetnick(struct fnetnode *fn, wchar_t *newnick);
struct fnet *findfnet(wchar_t *name);
-struct fnetnode *fnetinitconnect(wchar_t *name, char *addr, struct wcspair *args);
+struct fnetnode *fnetinitconnect(wchar_t *name, wchar_t *owner, char *addr, struct wcspair *args);
void linkfnetnode(struct fnetnode *fn);
void unlinkfnetnode(struct fnetnode *fn);
void getfnetnode(struct fnetnode *fn);
} else {
freeargs = 0;
}
- if((newfn = fnetinitconnect(L"dc", args, NULL)) != NULL)
+ if((newfn = fnetinitconnect(L"dc", fn->owner, args, NULL)) != NULL)
{
linkfnetnode(newfn);
putfnetnode(newfn);
args = NULL;
for(i = 3; i < argc - 1; i += 2)
newwcspair(argv[i], argv[i + 1], &args);
- fn = fnetinitconnect(argv[1], buf, args);
+ fn = fnetinitconnect(argv[1], data->userinfo->name, buf, args);
err = errno;
free(buf);
if(fn == NULL)