Subject: interrupted file transfers not logged?

From: "Roger A. Hanke" <[email-masked]>
Date: Fri, 17 Oct 1997 16:29:41 -0400

Well I noticed a couple scenarios when file transfers, downloads, from 
various FTP clients did not get any xferlog entry when the client interrupted
the download. These were clients that did not send an ABORT command 
I should add. I am currently using Beta 13 version on Solaris 2.5.1.

The best example was Navigator 3.0 when hit on cancel or STOP button during
download. Another example is if you hit ^C from Win95/NT Dos based
FTP client. These do show up as broken pipe or connection lost errors in
the server syslog when debugging is active. But no entry is made in the xferlog
regardless of how much data was actually transferred.

My managements question that I havent been able to answer is this.
If upon reception of an abort command WUFTPD server can correctly
log in xferlog how many bytes it transferred, how come it cant do this
in these other situations. Their concern is if people are downloading very
large files and frequently giving up on them, that we are using a lot of
resources and bandwidth that cant be accounted for or charged back 
to anybody.

They would like me to hack the WUFTPD server to make sure it always 
logs partial transfers, not just aborted ones. I can not believe this hasnt
been looked at or thought about already, so that there is probably more 
to it than that, so I have been resisting so far.
So any information or suggestions are gladly welcomed ;^>
	Thanx,
	Roger A. Hanke
------------------------------------------------------------------------------------
 Roger A. Hanke              AT&T Web Site Services
 (732)576-5738                   [email-masked] or
 FAX (732)576-6041                    [email-masked]
 LZ 1L-221                         http://lynxhub.att.com/~rah/	
------------------------------------------------------------------------------------

---

From: Dave Jevans <[email-masked]>
Date: Fri, 17 Oct 1997 17:37:35 -0700 (PDT)

>to it than that, so I have been resisting so far.

Roger,

It is in fact not super hard to add this.
Differential's commercial FileDrive servers,
based partially on wu-ftpd, have the capability of
logging failed versus completed transfers.

Flag them separately in the logfile.  There is
a field in each entry which indicates whether a 
transfer is upload or download.  We added 2 new flags
for this field... one indicates failed upload, the other
indicates failed download.  All other fields are the
same as the regular log.

Our Web-viewable stats engine, part of our secure Web-based
remote administration system, lets you view statistics about
failed versus completed transfers.

If you would like more info on the log format, contact me.

David Jevans

--
David Jevans                            http://www.differential.com
Email: [email-masked]          Phone: (408) 864-0603

Discover www.filedrive.com: Secure FTP and Extranet data management.

---

From: "Roger A. Hanke" <[email-masked]>
Date: Mon, 20 Oct 1997 09:45:15 -0400

Dave,
 
 Thanks for the response. Yeah that sounds like a good extension to the flags
field. What I was really concerned about though was changing such a
vital part of WUFTPD server operation, the logging subsystem. So how
involved are the coding changes to keep track of partial or interrupted 
transfers (non aborted ones)? And since I would want to submit this as a
patch to be accepted in a future release, is there anything you ended up 
doing that people might object to having in a future WUFTPD release?
I would prefer not having to introduce a new IFDEF for something like
this that I consider part of the servers basic operation. 

	Thanx,
	Roger Hanke  

----------
From: 	Dave Jevans[SMTP:[email-masked]]
Sent: 	Friday, October 17, 1997 8:37 PM
To: 	rah@lynxhub
Cc: 	[email-masked]
Subject: 	Re: interrupted file transfers not logged?

Roger,

David Jevans

---

From: Dave Jevans <[email-masked]>
Date: Mon, 20 Oct 1997 10:39:20 -0700 (PDT)

>vital part of WUFTPD server operation, the logging subsystem. So ho
>involved are the coding changes to keep track of partial or interrupte

Roger,

Adding logging of interuppted and aborted transfers is easy and pretty
self contained.

You will modify two functions in ftpd.c

retrieve() and store()

track the return value of the transfer functions receive_data
and send_data() routines respectively.  Also track the return status
of the dataconn() routine, which sets up the sockets for the
transfer.

If these routines fail, then change the goto so that it goes
to the logging code at the end of the retrieve() and store() functions,
instead of going to the end of the functions without executing the
logging code.

The file logging is 2 lines of code that sprintfs the log string
and then writes it to the logfile.   Change the sprinf so that insead
of just putting an "i" or "o" for whether the file is incomgin
or outgoing, you do a ?: operator and print a different char
for the status of the transfer:

For outgoing transfers:
                (dataerr == -1 ? 'p' : (dataerr == -2 ? 'q' : 'o')),   
                /* 'o' == OK, 'p' == error, 'q' == aborted */

For incoming transfers:
                (dataerr == -1 ? 'j' : (dataerr == -2 ? 'k' : 'i')),
                /* 'i' == OK, 'j' == error, 'k' == aborted */

DJ
---

         Secure FTP and Extranet data management.
                      www.filedrive.com