*/
// #define USE_NCURSES
+/* dont care about ncurses .. go for gtk(2)! */
+#define USE_GTK
#include "ivac.h"
int ivac_receive_info(int channel,t_ivac *ivac) {
char data[SEND_N_MAX];
+ char c_str[IVAC_CONSOLE_STRING_LEN];
int count,length;
count=0;
break;
case IVAC_SEND_QUIT:
if(!(strncmp(data+count+2,"quit",data[1])))
+ sprintf(c_str,"channel %02d: connection closed by remote host",
+ channel);
event_math(ivac->net.connection[channel].fd,&(ivac->event),
READ,REMOVE);
network_close(&(ivac->net),channel);
memset(&(ivac->challenger[channel]),0,sizeof(t_challenger));
+ ivac_add_to_monitor(ivac,c_str);
count+=6;
+ break;
default:
- printf("[ivac] ivac_receive_info, unknown character: (%c,%02x\n",
+ sprintf(c_str,"ivac_receive_info, unknown character: 0x%02x\n",
data[count]);
+ ivac_add_to_monitor(ivac,c_str);
return ERROR;
break;
}
for(channel=0;channel<MAX_CONNECTIONS;channel++) {
if(ivac->net.connection[channel].status&C_ESTABL) {
/* remote is sending info */
- if(FD_ISSET(ivac->net.connection[channel].fd,&(event->rfds)))
+ if(FD_ISSET(ivac->net.connection[channel].fd,&(event->rfds))) {
ivac_receive_info(channel,ivac);
ivac_display_content(ivac);
+ }
}
}