|
|
@ -895,13 +895,22 @@ int session(void)
|
|
|
|
* Write total amount of received/sent bytes, files, etc.
|
|
|
|
* Write total amount of received/sent bytes, files, etc.
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
p_log_txrxstat(&pi);
|
|
|
|
p_log_txrxstat(&pi);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Protocol info - real info from protocol
|
|
|
|
|
|
|
|
DEB((D_EVENT,"sess_main: Pi stats> Net: %d, Arc: %d, Fil: %d, Tic: %d",
|
|
|
|
|
|
|
|
pi.traffic_rcvd.netmail_num, pi.traffic_rcvd.arcmail_num,
|
|
|
|
|
|
|
|
pi.traffic_rcvd.files_num, pi.traffic_rcvd.ticfile_num));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Session info - HANDSHAKE info for traffic
|
|
|
|
|
|
|
|
DEB((D_EVENT,"sess_main: Sess stats> Net: %d, Arc: %d, Fil: %d, Tic: %d",
|
|
|
|
|
|
|
|
state.traff_recv.netmail_num, state.traff_recv.arcmail_num,
|
|
|
|
|
|
|
|
state.traff_recv.files_num, state.traff_recv.ticfile_num));
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Raise flags if session incoming traffic was not empty
|
|
|
|
* Raise flags if session incoming traffic was not empty
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
if ( (p = conf_string(cf_incnet_flag)) )
|
|
|
|
if ( (p = conf_string(cf_incnet_flag)) )
|
|
|
|
if (state.traff_recv.netmail_size > 0) {
|
|
|
|
if (pi.traffic_rcvd.netmail_size > 0) {
|
|
|
|
DEB((D_EVENT, "Incoming netmail > 0, raising flag"));
|
|
|
|
DEB((D_EVENT, "Incoming netmail > 0, raising flag"));
|
|
|
|
log("Raising flag for netmail in %s", p);
|
|
|
|
log("Raising flag for netmail in %s", p);
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP );
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP );
|
|
|
@ -915,7 +924,7 @@ int session(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( (p = conf_string(cf_incarc_flag)) )
|
|
|
|
if ( (p = conf_string(cf_incarc_flag)) )
|
|
|
|
if (state.traff_recv.arcmail_size > 0) {
|
|
|
|
if (pi.traffic_rcvd.arcmail_size > 0) {
|
|
|
|
DEB((D_EVENT, "Incoming arcmail > 0, raising flag"));
|
|
|
|
DEB((D_EVENT, "Incoming arcmail > 0, raising flag"));
|
|
|
|
log("Raising flag for arcmail in %s", p);
|
|
|
|
log("Raising flag for arcmail in %s", p);
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
|
|
@ -928,6 +937,33 @@ int session(void)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( (p = conf_string(cf_inctic_flag)) )
|
|
|
|
|
|
|
|
if (pi.traffic_rcvd.ticfile_num > 0) {
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Incoming TIC files > 0, raising flag"));
|
|
|
|
|
|
|
|
log("Raising flag for TIC in %s", p);
|
|
|
|
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
|
|
|
|
|
|
|
if (fd == -1) {
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Error raising ticfiles flag"));
|
|
|
|
|
|
|
|
log("Error creating flag for ticfiles in %s", p);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* all ok - closing file */
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if ( (p = conf_string(cf_incfile_flag)) )
|
|
|
|
|
|
|
|
if (pi.traffic_rcvd.files_size > 0) {
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Incoming FILES > 0, raising flag"));
|
|
|
|
|
|
|
|
log("Raising flag for files in %s", p);
|
|
|
|
|
|
|
|
fd = open(p, O_CREAT | O_WRONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
|
|
|
|
|
|
|
|
if (fd == -1) {
|
|
|
|
|
|
|
|
DEB((D_EVENT, "Error raising files flag"));
|
|
|
|
|
|
|
|
log("Error creating flag for files in %s", p);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
/* all ok - closing file */
|
|
|
|
|
|
|
|
close(fd);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Save session traffic before deiniting
|
|
|
|
* Save session traffic before deiniting
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|