|
|
@ -102,9 +102,9 @@ static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
|
|
|
/* network queue */
|
|
|
|
/* network queue */
|
|
|
|
#ifdef NETSPOOL
|
|
|
|
#ifdef NETSPOOL
|
|
|
|
|
|
|
|
|
|
|
|
log("netspool next file");
|
|
|
|
/*log("netspool next file");*/
|
|
|
|
if(state.netspool.state == NS_NOTINIT) {
|
|
|
|
if(state.netspool.state == NS_NOTINIT) {
|
|
|
|
log("new netspool connection");
|
|
|
|
/*log("new netspool connection");*/
|
|
|
|
char password[100];
|
|
|
|
char password[100];
|
|
|
|
char address[300];
|
|
|
|
char address[300];
|
|
|
|
char *host = conf_string(cf_netspool_host);
|
|
|
|
char *host = conf_string(cf_netspool_host);
|
|
|
@ -121,18 +121,18 @@ static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
password[0] = 0;
|
|
|
|
password[0] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log("netspool start %s %s %s %s", host, port, address, password);
|
|
|
|
log("netspool start %s %s %s (pwd)", host, port, address);
|
|
|
|
netspool_start(&state.netspool, host, port, address, password);
|
|
|
|
netspool_start(&state.netspool, host, port, address, password);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(state.netspool.state == NS_READY) {
|
|
|
|
if(state.netspool.state == NS_READY) {
|
|
|
|
log("netspool request");
|
|
|
|
/*log("netspool request");*/
|
|
|
|
netspool_query(&state.netspool, "ALL");
|
|
|
|
netspool_query(&state.netspool, "ALL");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(state.netspool.state == NS_RECEIVING) {
|
|
|
|
if(state.netspool.state == NS_RECEIVING) {
|
|
|
|
log("netspool begin receive");
|
|
|
|
/*log("netspool begin receive");*/
|
|
|
|
netspool_receive(&state.netspool);
|
|
|
|
netspool_receive(&state.netspool);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log("netspool could not start receive");
|
|
|
|
log("netspool could not start receive");
|
|
|
@ -140,13 +140,13 @@ static int prot_get_next_file(s_filelist **dest, s_protinfo *pi)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(state.netspool.state == NS_RECVFILE) {
|
|
|
|
if(state.netspool.state == NS_RECVFILE) {
|
|
|
|
log("netspool start file");
|
|
|
|
/*log("netspool start file");*/
|
|
|
|
*dest = NULL;
|
|
|
|
*dest = NULL;
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(state.netspool.state == NS_READY) {
|
|
|
|
if(state.netspool.state == NS_READY) {
|
|
|
|
log("no files to receive");
|
|
|
|
log("netspool queue empty");
|
|
|
|
netspool_end(&state.netspool);
|
|
|
|
netspool_end(&state.netspool);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -486,7 +486,7 @@ int p_tx_readfile(char *buffer, size_t buflen, s_protinfo *pi)
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef NETSPOOL
|
|
|
|
#ifdef NETSPOOL
|
|
|
|
if(pi->send->fname==NULL && strcmp(pi->send->local_name, "NETSPOOL")==0 ) {
|
|
|
|
if(pi->send->fname==NULL && strcmp(pi->send->local_name, "NETSPOOL")==0 ) {
|
|
|
|
log("reading netspool file");
|
|
|
|
/*log("reading netspool file");*/
|
|
|
|
if( state.netspool.state != NS_RECVFILE ) {
|
|
|
|
if( state.netspool.state != NS_RECVFILE ) {
|
|
|
|
log("send: wrong netspool state");
|
|
|
|
log("send: wrong netspool state");
|
|
|
|
pi->send->status = FSTAT_SKIPPED;
|
|
|
|
pi->send->status = FSTAT_SKIPPED;
|
|
|
@ -499,10 +499,10 @@ int p_tx_readfile(char *buffer, size_t buflen, s_protinfo *pi)
|
|
|
|
pi->send->status = FSTAT_SKIPPED;
|
|
|
|
pi->send->status = FSTAT_SKIPPED;
|
|
|
|
return -2;
|
|
|
|
return -2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
log("got %d bytes from netspool", n);
|
|
|
|
/*log("got %d bytes from netspool", n);*/
|
|
|
|
return n;
|
|
|
|
return n;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
log("reading local file");
|
|
|
|
/*log("reading local file");*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|