From 62bbdbe1628d8aecc47b903050649f9c88a6c08f Mon Sep 17 00:00:00 2001 From: Michiel Broek Date: Fri, 12 Mar 2004 19:56:47 +0000 Subject: [PATCH] Bugfixes for binkp driver --- ChangeLog | 9 +++++++++ TODO | 6 +++--- mbcico/binkp.c | 31 ++++++++++++++++++++++++++++++- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09342673..de8d7639 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,15 @@ v0.51.2 06-Mar-2004 mbcico: Updated file request function to new files database structure. Fixed a compile problem on FreeBSD 5.1 + To test 3 bugfixes: + Fixed a bug when a m_get was received with file offset = file + size that would log a negative transfer time and transfer rate. + Fixed a bug when a m_get message was received with the current + file with offset = file size to properly close the file and + unlink from the outbound queue. + Fixed a bug when a m_get message was received on a file that + was already transmitted to remove that file from the outbound + queue. mbfido: When removing files during tic import due to replace or maximum diff --git a/TODO b/TODO index 26a8d283..1d06291d 100644 --- a/TODO +++ b/TODO @@ -78,7 +78,7 @@ mbtask: mbfido: N: When importing a tic file with magic name, remove the magic from - the filerecord of the previous file. + the filerecord of the previous file. (Is no corrected by mbfile c). N: The elist rules files are named (8.3) areaname.rul where areaname is the first 8 characters of the area name and we use the full name @@ -127,10 +127,10 @@ mbfido: N: When adding a record to the toberep database add check for existing older entry to update the info with the later received file. Else - just handle the record as a dupe. + just handle the record as a dupe (In test again). mbcico: - N: Further investigate binkp tty_error hangup. + N: Further investigate binkp tty_error hangup (Seems Oke). L: Implement binkp option ND. diff --git a/mbcico/binkp.c b/mbcico/binkp.c index 3d781cef..0790177e 100644 --- a/mbcico/binkp.c +++ b/mbcico/binkp.c @@ -2052,6 +2052,12 @@ int binkp_process_messages(void) if (cursend && (strcmp(lname, cursend->remote) == 0) && (lsize == cursend->size) && (ltime == cursend->date)) { Syslog('b', "Got M_GET with offset == filesize for current file, close"); + + /* + * calculate time needed and bytes transferred + */ + gettimeofday(&txtvend, &bp.tz); + /* * Close transmitter file */ @@ -2066,11 +2072,34 @@ int binkp_process_messages(void) txtvend.tv_sec - txtvstart.tv_sec); } - cursend->state = IsSent; + cursend->state = Got; // 12-03-2004 changed from IsSent, bug from LdG with FT. cursend = NULL; bp.TxState = TxGNF; + + for (tsl = tosend; tsl; tsl = tsl->next) { // Added 12-03 + if (tsl->remote == NULL) { + execute_disposition(tsl); + } else { + if (strcmp(cursend->local, tsl->local) == 0) { + execute_disposition(tsl); + } + } + } } else { Syslog('+', "Binkp: requested offset = filesize, but is not the current file"); + if (tmp->state == IsSent) { // Added 12-03 + Syslog('b', "Binkp: file is sent, treat as m_got"); + tmp->state = Got; + for (tsl = tosend; tsl; tsl = tsl->next) { + if (tsl->remote == NULL) { + execute_disposition(tsl); + } else { + if (strcmp(tmp->local, tsl->local) == 0) { + execute_disposition(tsl); + } + } + } + } } } else if (loffs < lsize) { tmp->state = NoState;