Updates for new inbound structures

This commit is contained in:
Michiel Broek 2003-08-23 15:55:45 +00:00
parent 9a6798b299
commit ab8aabed95
6 changed files with 121 additions and 125 deletions

View File

@ -123,12 +123,10 @@ int binkp(int role)
char *nonhold_mail;
if (role == 1) {
Syslog('+', "Binkp: start outbound session");
if (orgbinkp()) {
rc = MBERR_SESSION_ERROR;
}
} else {
Syslog('+', "Binkp: start inbound session");
if (ansbinkp()) {
rc = MBERR_SESSION_ERROR;
}

View File

@ -79,8 +79,6 @@ int rx_emsi(char *data)
fa_list *tmr;
int denypw=0;
Syslog('+', "Start inbound EMSI session");
emsi_local_lcodes = LCODE_RH1;
emsi_remote_lcodes=0;
@ -207,7 +205,6 @@ int tx_emsi(char *data)
{
int rc;
Syslog('+', "Start outbound EMSI session");
emsi_local_lcodes = LCODE_PUA | LCODE_RH1;
emsi_remote_lcodes = 0;

View File

@ -67,7 +67,6 @@ int rx_ftsc(void)
{
int rc;
Syslog('+', "Start inbound FTS-0001 session");
IsDoing("FTS-0001 inbound");
session_flags |= SESSION_BARK;
@ -94,7 +93,6 @@ int tx_ftsc(void)
{
int rc;
Syslog('+', "Start outbound FTS-0001 session with %s", ascfnode(remote->addr,0x1f));
IsDoing("FTS-0001 to %s", ascfnode(remote->addr, 0x0f));
if ((rc = txftsc())) {
@ -131,10 +129,7 @@ SM_EDECL
char *nonhold_mail;
int mailsent = FALSE, mailrcvd = FALSE;
// if (localoptions & NOHOLD)
nonhold_mail = (char *)ALL_MAIL;
// else
// nonhold_mail = (char *)NONHOLD_MAIL;
tosend = create_filelist(remote,nonhold_mail,2);
Syslog('s', "txftsc SEND_MAIL");
@ -157,7 +152,7 @@ SM_STATE(wait_command)
* Some systems hangup after sending mail, so if we did
* send and receive mail we consider the session OK.
*/
Syslog('+', "Lost carrier, FTSC session looks complete");
Syslog('+', "Lost carrier, FTS-0001 session looks complete");
SM_SUCCESS;
} else {
Syslog('+', "got error waiting for TSYNC: received %d",c);
@ -407,8 +402,8 @@ SM_STATE(scan_packet)
* handshake by sending us a .pkt file, we store this in the old
* style ../tmp/ dir in the unprotected inbound.
*/
fpath = xstrcpy(inbound);
fpath = xstrcat(fpath,(char *)"/");
fpath = xstrcpy(CFG.inbound);
fpath = xstrcat(fpath,(char *)"/tmp/");
fpath = xstrcat(fpath,recvpktname);
mkdirs(fpath, 0700);
fp = fopen(fpath,"r");

View File

@ -33,6 +33,8 @@
#include "../lib/structs.h"
#include "../lib/clcomm.h"
#include "../lib/common.h"
#include "../lib/users.h"
#include "../lib/records.h"
#include "config.h"
#include "lutil.h"
#include "openfile.h"
@ -82,8 +84,17 @@ FILE *openfile(char *fname, time_t remtime, off_t remsize, off_t *resofs, int(*r
* If it's there, resoffs will be set equal to remsize to signal the
* receiving protocol to skip the file.
*/
if (tempinbound == NULL) {
/*
* This is when we get a FTS-0001 handshake packet
*/
infpath = xstrcpy(CFG.inbound);
infpath = xstrcat(infpath, (char *)"/tmp/");
mkdirs(infpath, 0700);
} else {
infpath = xstrcpy(tempinbound);
infpath = xstrcat(infpath, (char *)"/");
}
infpath = xstrcat(infpath, fname);
if (stat(infpath, &st) == 0) {
/* FIXME: temp normal logging now! */

View File

@ -70,7 +70,7 @@ char *typestr(int);
char *typestr(int tp)
{
switch (tp) {
case SESSION_FTSC: return (char *)"FTSC";
case SESSION_FTSC: return (char *)"FTS-0001";
case SESSION_YOOHOO: return (char *)"YooHoo/2U2";
case SESSION_EMSI: return (char *)"EMSI";
case SESSION_BINKP: return (char *)"Binkp";
@ -82,18 +82,17 @@ char *typestr(int tp)
int session(faddr *a, node *nl, int role, int tp, char *dt)
{
int rc = MBERR_OK;
int rc = MBERR_OK, addrlen = sizeof(struct sockaddr_in);
fa_list *tmpl;
int addrlen = sizeof(struct sockaddr_in);
session_flags = 0;
type = tp;
nlent = nl;
if (role) {
Syslog('s', "Start outbound session type %s with %s", typestr(type), ascfnode(a,0x1f));
} else
Syslog('s', "Start inbound session type %s", typestr(type));
if (role)
Syslog('+', "Start outbound %s session with %s", typestr(type), ascfnode(a,0x1f));
else
Syslog('+', "Start inbound %s session", typestr(type));
if (getpeername(0,(struct sockaddr*)&peeraddr,&addrlen) == 0) {
Syslog('s', "TCP connection: len=%d, family=%hd, port=%hu, addr=%s",

View File

@ -128,8 +128,6 @@ int rx_yoohoo(void)
unsigned short capabilities,localcaps;
char *pwd = NULL;
Syslog('+', "Start inbound YooHoo session");
pwd = NULL;
localcaps = LOCALCAPS;
if (localoptions & NOZMODEM) localcaps &= ~(ZED_ZAPPER|ZED_ZIPPER);
@ -228,8 +226,6 @@ int tx_yoohoo(void)
unsigned short capabilities;
char *pwd;
Syslog('+', "Start outbound YooHoo session");
if (strlen(nodes.Spasswd))
pwd = xstrcpy(nodes.Spasswd);
else