projects
/
my-code
/
ivac.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
only set reuseaddr socket opt if regular bind call fails
[my-code/ivac.git]
/
src
/
ivac.c
diff --git
a/src/ivac.c
b/src/ivac.c
index
ca12131
..
8b9c312
100644
(file)
--- a/
src/ivac.c
+++ b/
src/ivac.c
@@
-184,7
+184,7
@@
int ivac_event_cb(t_event *event,void *ptr) {
else if(channel==N_E_MAXC)
sprintf(c_str,"maximum connections reached");
else {
else if(channel==N_E_MAXC)
sprintf(c_str,"maximum connections reached");
else {
- sprintf(c_str,"
established connection from %s port %d on channel %d\n
",
+ sprintf(c_str,"
connection from %s port %d on channel %d
",
ivac->net.connection[channel].ip,
ivac->net.connection[channel].port,channel);
ivac_add_to_monitor(ivac,c_str);
ivac->net.connection[channel].ip,
ivac->net.connection[channel].port,channel);
ivac_add_to_monitor(ivac,c_str);
@@
-200,6
+200,7
@@
int ivac_event_cb(t_event *event,void *ptr) {
/* remote is sending info */
if(FD_ISSET(ivac->net.connection[channel].fd,&(event->rfds)))
ivac_receive_info(channel,ivac);
/* remote is sending info */
if(FD_ISSET(ivac->net.connection[channel].fd,&(event->rfds)))
ivac_receive_info(channel,ivac);
+ ivac_display_content(ivac);
}
}
}
}
@@
-273,9
+274,7
@@
int ivac_parse_command(t_input *input,void *ptr) {
sprintf(c_str,"changed username to %s",ivac->username);
}
else if((channel>=0)&&(channel<MAX_CONNECTIONS)) {
sprintf(c_str,"changed username to %s",ivac->username);
}
else if((channel>=0)&&(channel<MAX_CONNECTIONS)) {
- i=network_set_connection_info(&(ivac->net),channel,
- ivac->net.connection[channel].ip,
- ivac->net.connection[channel].port);
+ i=network_set_connection_info(&(ivac->net),channel,arg[2],atoi(arg[3]));
if(i==N_E_IN_USE)
sprintf(c_str,"channel %02d: connection in use",channel);
if(i==N_SUCCESS)
if(i==N_E_IN_USE)
sprintf(c_str,"channel %02d: connection in use",channel);
if(i==N_SUCCESS)