Compare commits
4
Commits
0.25.2
...
a1c93b8016
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1c93b8016 | ||
|
|
e6266e8eab | ||
|
|
34daba8a0e | ||
|
|
ea4e8c806f |
@@ -124,7 +124,7 @@ int binkp_loop(s_binkp_state *bstate) {
|
|||||||
bstate->continuesend = false;
|
bstate->continuesend = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (have_to_write==0 && (!no_more_to_send || bstate->extracmd[0]!=-1)) {
|
if (have_to_write==0 && (!no_more_to_send || bstate->extracmd[0]!=(char)-1)) {
|
||||||
m = binkp_getforsend(bstate, writebuf+BINKP_HEADER, &block_type, &block_length);
|
m = binkp_getforsend(bstate, writebuf+BINKP_HEADER, &block_type, &block_length);
|
||||||
if(m==1 || m==3) {
|
if(m==1 || m==3) {
|
||||||
//DEB((D_24554, "got block for sending %d %hu", block_type, block_length));
|
//DEB((D_24554, "got block for sending %d %hu", block_type, block_length));
|
||||||
@@ -340,7 +340,7 @@ int binkp_getforsend(s_binkp_state *bstate, char *buf, int *block_type, unsigned
|
|||||||
{
|
{
|
||||||
int my_sf, wr_pos;
|
int my_sf, wr_pos;
|
||||||
int n; // read file
|
int n; // read file
|
||||||
if (bstate->extracmd[0]!=-1) {
|
if (bstate->extracmd[0]!=(char)-1) {
|
||||||
DEB((D_24554, "Send cmd to remote %d %s", bstate->extracmd[0], bstate->extracmd+1));
|
DEB((D_24554, "Send cmd to remote %d %s", bstate->extracmd[0], bstate->extracmd+1));
|
||||||
buf[0] = bstate->extracmd[0];
|
buf[0] = bstate->extracmd[0];
|
||||||
strcpy(buf+1, bstate->extracmd+1);
|
strcpy(buf+1, bstate->extracmd+1);
|
||||||
@@ -668,12 +668,12 @@ case BPMSG_ADR: /* List of addresses */
|
|||||||
if (bstate->address_established) {
|
if (bstate->address_established) {
|
||||||
PROTO_ERROR("remote tries to change address");
|
PROTO_ERROR("remote tries to change address");
|
||||||
}
|
}
|
||||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend !!!
|
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend !!!
|
||||||
binkp_process_ADR(buf+1);
|
binkp_process_ADR(buf+1);
|
||||||
|
|
||||||
if( !state.n_remoteaddr ) {
|
if( !state.n_remoteaddr ) {
|
||||||
log("error: remote did not supplied any addresses");
|
log("error: remote did not supplied any addresses");
|
||||||
if( bstate->extracmd[0] !=-1 ) return 0; // suspend
|
if( bstate->extracmd[0] != (char)-1 ) return 0; // suspend
|
||||||
bstate->extracmd[0] = BPMSG_BSY;
|
bstate->extracmd[0] = BPMSG_BSY;
|
||||||
strcpy(bstate->extracmd+1, "No addresses was presented");
|
strcpy(bstate->extracmd+1, "No addresses was presented");
|
||||||
bstate->extraislast = true;
|
bstate->extraislast = true;
|
||||||
@@ -844,7 +844,7 @@ case BPMSG_OK: /* Password was acknowleged (data ignored) */
|
|||||||
}
|
}
|
||||||
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
|
if (session_addrs_lock(state.remoteaddrs, state.n_remoteaddr)) {
|
||||||
log("error: unable to lock");
|
log("error: unable to lock");
|
||||||
if (bstate->extracmd[0]!=-1) return 0;
|
if (bstate->extracmd[0]!= (char)-1) return 0;
|
||||||
bstate->extracmd[0] = BPMSG_BSY;
|
bstate->extracmd[0] = BPMSG_BSY;
|
||||||
strcpy(bstate->extracmd+1, "All addresses are busy");
|
strcpy(bstate->extracmd+1, "All addresses are busy");
|
||||||
bstate->extraislast = true;
|
bstate->extraislast = true;
|
||||||
@@ -954,7 +954,7 @@ case BPMSG_GET: /* Get a file from offset */
|
|||||||
}
|
}
|
||||||
DEB((D_24554, "M_GET file %s size %d time %d offset %d", getfi.fn, getfi.sz, getfi.tm, getfi.offs));
|
DEB((D_24554, "M_GET file %s size %d time %d offset %d", getfi.fn, getfi.sz, getfi.tm, getfi.offs));
|
||||||
|
|
||||||
if (bstate->extracmd[0] != -1) return 0;
|
if (bstate->extracmd[0] != (char)-1) return 0;
|
||||||
|
|
||||||
if (bstate->pi->send) if (p_compfinfo(bstate->pi->send, getfi.fn, getfi.sz, getfi.tm)==0) {
|
if (bstate->pi->send) if (p_compfinfo(bstate->pi->send, getfi.fn, getfi.sz, getfi.tm)==0) {
|
||||||
DEB((D_24554, "M_GET for currently transmitted file"));
|
DEB((D_24554, "M_GET for currently transmitted file"));
|
||||||
@@ -1044,7 +1044,7 @@ case BINKP_BLK_DATA:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bstate->extracmd[0] != -1) return 0;
|
if (bstate->extracmd[0] != (char)-1) return 0;
|
||||||
|
|
||||||
long int n;
|
long int n;
|
||||||
n = p_rx_writefile(buf, block_length, bstate->pi);
|
n = p_rx_writefile(buf, block_length, bstate->pi);
|
||||||
|
|||||||
Reference in New Issue
Block a user