|
@@ -202,8 +202,8 @@ int session_broadcast(int sid, char *msg, char *usrname, int except, int flags)
|
|
|
|
|
|
|
|
|
|
|
|
|
int session_name(int fd, struct vcc_request *req) {
|
|
int session_name(int fd, struct vcc_request *req) {
|
|
|
- struct klist_node *n;
|
|
|
|
|
struct vcc_request *out;
|
|
struct vcc_request *out;
|
|
|
|
|
+ char *p;
|
|
|
|
|
|
|
|
if (unlikely(!(out = amalloc(sizeof(struct vcc_request))))) {
|
|
if (unlikely(!(out = amalloc(sizeof(struct vcc_request))))) {
|
|
|
vcc_log("*** malloc() failed\n");
|
|
vcc_log("*** malloc() failed\n");
|
|
@@ -215,9 +215,9 @@ int session_name(int fd, struct vcc_request *req) {
|
|
|
out->reqtype = htonl(REQ_CTL_SENAME);
|
|
out->reqtype = htonl(REQ_CTL_SENAME);
|
|
|
|
|
|
|
|
if (req->session == 0)
|
|
if (req->session == 0)
|
|
|
- strcpy(out->msg, "broadcast");
|
|
|
|
|
|
|
+ p = "broadcast";
|
|
|
|
|
|
|
|
- else if (unlikely(!(n = find_session(ntohl(req->session))))) {
|
|
|
|
|
|
|
+ else if (unlikely(!(p = find_session(ntohl(req->session))->usrname))) {
|
|
|
out->session = htonl(-1);
|
|
out->session = htonl(-1);
|
|
|
vcc_send_req(find_connection(fd), out);
|
|
vcc_send_req(find_connection(fd), out);
|
|
|
|
|
|
|
@@ -226,13 +226,12 @@ int session_name(int fd, struct vcc_request *req) {
|
|
|
return 1;
|
|
return 1;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- else
|
|
|
|
|
- strcpy(out->msg, n->usrname);
|
|
|
|
|
|
|
+ strcpy(out->msg, p);
|
|
|
|
|
|
|
|
out->session = req->session;
|
|
out->session = req->session;
|
|
|
vcc_send_req(find_connection(fd), out);
|
|
vcc_send_req(find_connection(fd), out);
|
|
|
|
|
|
|
|
- vcc_log("sename: %s sent to %d\n", n->usrname, fd);
|
|
|
|
|
|
|
+ vcc_log("sename: %s sent to %d\n", p, fd);
|
|
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
|
}
|
|
}
|