Routines to handle file transfers.
Copyright (C) 1992 Ian Lance Taylor
This file is part of the Taylor UUCP package.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
The author of the program may be contacted at ian@airs.com or
c/o Infinity Development Systems, P.O. Box 520, Waltham, MA 02254.
const char trans_rcsid
[] = "$Id: trans.c,v 1.1 1993/08/04 19:36:31 jtc Exp $";
static void utqueue
P((struct stransfer
**, struct stransfer
*,
static void utdequeue
P((struct stransfer
*));
static void utchanalc
P((struct sdaemon
*qdaemon
, struct stransfer
*qtrans
));
__inline__
static struct stransfer
*qtchan
P((int ichan
));
__inline__
static void utchanfree
P((struct stransfer
*qtrans
));
static boolean ftcharge
P((struct sdaemon
*qdaemon
,
struct stransfer
*qtrans
,
boolean fsend
, boolean fforce
));
static boolean fcheck_queue
P((struct sdaemon
*qdaemon
));
static boolean ftadd_cmd
P((struct sdaemon
*qdaemon
, const char *z
,
size_t cdata
, int iremote
, boolean flast
));
static boolean fremote_hangup_reply
P((struct stransfer
*qtrans
,
struct sdaemon
*qdaemon
));
static boolean flocal_poll_file
P((struct stransfer
*qtrans
,
struct sdaemon
*qdaemon
));
/* Queue of transfer structures that are ready to start which have
been requested by the local system. These are only permitted to
start when the local system is the master. */
static struct stransfer
*qTlocal
;
/* Queue of transfer structures that are ready to start which have
been requested by the remote system. These are responses to
commands received from the remote system, and should be started as
static struct stransfer
*qTremote
;
/* Queue of transfer structures that have been started and want to
send information. This should be static, but the 'a' protocol
looks at it, at least for now. */
struct stransfer
*qTsend
;
/* Queue of transfer structures that have been started and are waiting
to receive information. */
static struct stransfer
*qTreceive
;
/* Queue of free transfer structures. */
static struct stransfer
*qTavail
;
/* Array of transfer structures indexed by local channel number. This
is maintained for local jobs. */
static struct stransfer
*aqTchan
[IMAX_CHAN
+ 1];
/* Number of local channel numbers currently allocated. */
/* Next channel number to allocate. */
/* Array of transfer structures indexed by remote channel number.
This is maintained for remote jobs. */
static struct stransfer
*aqTremote
[IMAX_CHAN
+ 1];
/* A structure used to charge time to file transfers. */
/* The transfer we are currently charging. */
struct stransfer
*qtrans
;
/* The time at the last update. */
/* We are always charging one send and one receive. */
static struct scharge sTsend
;
static struct scharge sTreceive
;
/* The minimum amount of time, in seconds, to wait between times we
check the spool directory, if we are busy transferring data. If we
have nothing to do, we will check the spool directory regardless of
how long ago the last check was. This should probably be
/* The time we last checked the spool directory for work. This is set
from the return value of ixsysdep_process_time, not ixsysdep_time,
for convenience in the routines which use it. */
/* The size of the command we have read so far in ftadd_cmd. */
/* The structure we use when waiting for an acknowledgement of a
confirmed received file in fsent_receive_ack, and a list of those
struct sreceive_ack
*qnext
;
static struct sreceive_ack
*qTreceive_ack
;
/* Queue up a transfer structure before *pq. This puts it at the head
or the tail of the list headed by *pq. */
/* Dequeue a transfer structure. */
*(q
->pqqueue
) = q
->qnext
;
q
->qprev
->qnext
= q
->qnext
;
q
->qnext
->qprev
= q
->qprev
;
/* Queue up a transfer structure requested by the local system. */
fqueue_local (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
utqueue (&qTlocal
, qtrans
, FALSE
);
/* Queue up a transfer structure requested by the remote system. The
stransfer structure should have the iremote field set. We need to
record it, so that any subsequent data associated with this
channel can be routed to the right place. */
fqueue_remote (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO
, "fqueue_remote: Channel %d",
aqTremote
[qtrans
->iremote
] = qtrans
;
utqueue (&qTremote
, qtrans
, FALSE
);
/* We just received data for this transfer, so start charging. */
return ftcharge (qdaemon
, qtrans
, FALSE
, FALSE
);
/* Queue up a transfer with something to send. */
fqueue_send (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
if (qtrans
->psendfn
== NULL
)
ulog (LOG_FATAL
, "fqueue_send: Bad call");
utqueue (&qTsend
, qtrans
, FALSE
);
/* Since we're now going to wait to send data, don't charge this
transfer for receive time. */
if (qtrans
== sTreceive
.qtrans
)
return ftcharge (qdaemon
, (struct stransfer
*) NULL
, FALSE
, FALSE
);
/* Queue up a transfer with something to receive. */
fqueue_receive (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
if (qtrans
->precfn
== NULL
)
ulog (LOG_FATAL
, "fqueue_receive: Bad call");
utqueue (&qTreceive
, qtrans
, FALSE
);
/* Since we are now going to wait to receive data, don't charge this
transfer for send time. */
if (qtrans
== sTsend
.qtrans
)
return ftcharge (qdaemon
, (struct stransfer
*) NULL
, TRUE
, FALSE
);
/* Get a new local channel number. */
utchanalc (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
if (iTchan
> qdaemon
->qproto
->cchans
)
while (aqTchan
[iTchan
] != NULL
);
aqTchan
[iTchan
] = qtrans
;
/* Return the transfer for a channel number. */
static struct stransfer
*
/* Clear the channel number for a transfer. */
aqTchan
[qt
->ilocal
] = NULL
;
/* Allocate a new transfer structure. */
register struct stransfer
*q
;
q
= (struct stransfer
*) xmalloc (sizeof (struct stransfer
));
q
->s
.zfrom
= zbufcpy (qcmd
->zfrom
);
q
->s
.zto
= zbufcpy (qcmd
->zto
);
q
->s
.zuser
= zbufcpy (qcmd
->zuser
);
q
->s
.zoptions
= zbufcpy (qcmd
->zoptions
);
q
->s
.ztemp
= zbufcpy (qcmd
->ztemp
);
q
->s
.znotify
= zbufcpy (qcmd
->znotify
);
q
->s
.zcmd
= zbufcpy (qcmd
->zcmd
);
/* Free a transfer structure. This does not free any pinfo
information that may have been allocated. */
ubuffree ((char *) q
->s
.zfrom
);
ubuffree ((char *) q
->s
.zto
);
ubuffree ((char *) q
->s
.zuser
);
ubuffree ((char *) q
->s
.zoptions
);
ubuffree ((char *) q
->s
.ztemp
);
ubuffree ((char *) q
->s
.znotify
);
ubuffree ((char *) q
->s
.zcmd
);
aqTremote
[q
->iremote
] = NULL
;
/* Don't try to charge time to this structure any longer. */
if (sTreceive
.qtrans
== q
)
utqueue (&qTavail
, q
, FALSE
);
/* Handle timing of file tranfers. This is called when processing
starts for a transfer structure. All time up to the next call to
this function is charged to that transfer structure. Sending time
and receiving time are charged separately. Normally if we are
about to start charging the same structure we are already charging,
we do nothing; but if the fforce argument is TRUE, we charge the
ftcharge (qdaemon
, qtrans
, fsend
, fforce
)
struct stransfer
*qtrans
;
struct scharge
*qcharge
, *qother
;
long inextsecs
, inextmicros
;
if (! fforce
&& qtrans
== qcharge
->qtrans
)
inextsecs
= ixsysdep_process_time (&inextmicros
);
if (qcharge
->qtrans
!= NULL
)
qcharge
->qtrans
->isecs
+= inextsecs
- qcharge
->isecs
;
qcharge
->qtrans
->imicros
+= inextmicros
- qcharge
->imicros
;
/* If we are charging the same structure for both send and
receive, update the time we are not currently charging so
that we don't charge twice for the same time. */
if (qcharge
->qtrans
== qother
->qtrans
)
qother
->isecs
= inextsecs
;
qother
->imicros
= inextmicros
;
qcharge
->qtrans
= qtrans
;
qcharge
->isecs
= inextsecs
;
qcharge
->imicros
= inextmicros
;
/* If enough time has elapsed since the last time we checked the
queue, check it again. We do this here because we have already
gone to the trouble of getting the time. */
if (inextsecs
- iTchecktime
>= CCHECKWAIT
)
if (! fcheck_queue (qdaemon
))
/* Gather local commands and queue them up for later processing. Also
recompute time based control values. */
const struct uuconf_system
*qsys
;
struct uuconf_timespan
*qlocal_size
, *qremote_size
;
/* If we are not the caller, the grade will be set during the
bgrade
= qdaemon
->bgrade
;
if (! ftimespan_match (qsys
->uuconf_qtimegrade
, &ival
,
/* Determine the maximum sizes we can send and receive. */
qlocal_size
= qsys
->uuconf_qcall_local_size
;
qremote_size
= qsys
->uuconf_qcall_remote_size
;
qlocal_size
= qsys
->uuconf_qcalled_local_size
;
qremote_size
= qsys
->uuconf_qcalled_remote_size
;
if (! ftimespan_match (qlocal_size
, &qdaemon
->clocal_size
, (int *) NULL
))
qdaemon
->clocal_size
= (long) -1;
if (! ftimespan_match (qremote_size
, &qdaemon
->cremote_size
, (int *) NULL
))
qdaemon
->cremote_size
= (long) -1;
if (! fsysdep_get_work_init (qsys
, bgrade
))
if (! fsysdep_get_work (qsys
, bgrade
, &s
))
ulog_user ((const char *) NULL
);
struct stransfer
*qtrans
;
ulog_user ((const char *) NULL
);
qtrans
->psendfn
= flocal_poll_file
;
if (! fqueue_local (qdaemon
, qtrans
))
if (! flocal_send_file_init (qdaemon
, &s
))
if (! flocal_rec_file_init (qdaemon
, &s
))
if (! flocal_xcmd_init (qdaemon
, &s
))
ulog (LOG_FATAL
, "fqueue: Can't happen");
*pfany
= qTlocal
!= NULL
;
iTchecktime
= ixsysdep_process_time ((long *) NULL
);
/* Clear everything off the work queue. This is used when the call is
complete, or if the call is never made. */
usysdep_get_work_free (qdaemon
->qsys
);
for (i
= 0; i
< IMAX_CHAN
+ 1; i
++)
/* Recheck the work queue during a conversation. This is only called
if it's been more than CCHECKWAIT seconds since the last time the
/* Only check if we are the master, or if there are multiple
channels, or if we aren't already trying to get the other side to
hang up. Otherwise, there's nothing we can do with any new jobs
if ((qdaemon
->ireliable
& UUCONF_RELIABLE_FULLDUPLEX
) == 0)
cchans
= qdaemon
->qproto
->cchans
;
|| ! qdaemon
->frequest_hangup
)
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
,
"fcheck_queue: Rechecking work queue");
if (! fqueue (qdaemon
, &fany
))
/* If we found something to do, and we're not the master, and we
don't have multiple channels to send new jobs over, try to
get the other side to hang up. */
if (fany
&& ! qdaemon
->fmaster
&& cchans
<= 1)
qdaemon
->frequest_hangup
= TRUE
;
/* The main transfer loop. The uucico daemon spends essentially all
its time in this function. */
/* If we are using a half-duplex line, act as though we have only a
single channel; otherwise we might start a send and a receive at
if ((qdaemon
->ireliable
& UUCONF_RELIABLE_FULLDUPLEX
) == 0)
cchans
= qdaemon
->qproto
->cchans
;
while (! qdaemon
->fhangup
)
register struct stransfer
*q
;
/* If we're doing any debugging, close the log and debugging
files regularly. This will let people copy them off and
remove them while the conversation is in progresss. */
/* We've managed to become the master, so we no longer want
qdaemon
->frequest_hangup
= FALSE
;
if (qdaemon
->fhangup_requested
/* The remote system has requested that we transfer
control by sending CYM after receiving a file. */
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
,
"floop: Transferring control at remote request");
else if (qTremote
== NULL
/* We don't have anything to do. Try to find some new
jobs. If we can't, transfer control. */
if (! fqueue (qdaemon
, (boolean
*) NULL
))
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
,
"floop: No work for master");
if (! (*qdaemon
->qproto
->pfsendcmd
) (qdaemon
, "H", 0, 0))
qdaemon
->fmaster
= FALSE
;
/* If we are no long the master, clear any requested hangup. We
may have already hung up before checking this variable in the
qdaemon
->fhangup_requested
= FALSE
;
/* Immediately queue up any remote jobs. We don't need local
channel numbers for them, since we can disambiguate based on
the remote channel number. */
utqueue (&qTsend
, q
, TRUE
);
/* If we are the master, or if we have multiple channels, try to
queue up additional local jobs. */
if (qdaemon
->fmaster
|| cchans
> 1)
while (qTlocal
!= NULL
&& cTchans
< cchans
)
/* We have room for an additional channel. */
if (! fqueue_send (qdaemon
, q
))
ulog_user ((const char *) NULL
);
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
, "floop: Waiting for data");
if (! (*qdaemon
->qproto
->pfwait
) (qdaemon
))
if (! ftcharge (qdaemon
, q
, TRUE
, TRUE
))
if (! (*q
->psendfn
) (q
, qdaemon
))
if (! ftcharge (qdaemon
, q
, TRUE
, FALSE
))
ulog (LOG_NORMAL
, "%s", q
->zlog
);
/* We can read the file in a tight loop until qTremote
changes or until we have transferred the entire file.
We can disregard any changes to qTlocal since we
already have something to send anyhow. */
zdata
= (*qdaemon
->qproto
->pzgetspace
) (qdaemon
, &cdata
);
cdata
= cfileread (q
->e
, zdata
, cdata
);
if (ffilereaderror (q
->e
, cdata
))
/* There is no way to report a file reading
error, so we just drop the connection. */
ulog (LOG_ERROR
, "read: %s", strerror (errno
));
if (! (*qdaemon
->qproto
->pfsenddata
) (qdaemon
, zdata
,
/* It is possible that this transfer has just been
if (q
!= qTsend
|| ! q
->fsendfile
)
/* We must update the time now, because this
call may make an entry in the statistics
if (! ftcharge (qdaemon
, q
, TRUE
, TRUE
))
if (! (*q
->psendfn
) (q
, qdaemon
))
ulog_user ((const char *) NULL
);
(void) (*qdaemon
->qproto
->pfshutdown
) (qdaemon
);
uwindow_acked (qdaemon
, TRUE
);
/* This is called by the protocol routines when they have received
some data. If pfexit is not NULL, *pfexit should be set to TRUE if
the protocol receive loop should exit back to the main floop
routine, above. It is only important to set *pfexit to TRUE if the
main loop called the pfwait entry point, so we need never set it to
TRUE if we just receive data for a file. This routine never sets
fgot_data (qdaemon
, zfirst
, cfirst
, zsecond
, csecond
, ilocal
, iremote
, ipos
,
if (fallacked
&& qTreceive_ack
!= NULL
)
uwindow_acked (qdaemon
, TRUE
);
/* Now we have to decide which transfer structure gets the data. If
ilocal is -1, it means that the protocol does not know where to
route the data. In that case we route it to the first transfer
that is waiting for data, or, if none, as a new command. If
ilocal is 0, we either select based on the remote channel number
or we have a new command. */
if (ilocal
== -1 && qTreceive
!= NULL
)
else if (ilocal
== 0 && iremote
> 0 && aqTremote
[iremote
] != NULL
)
ulog_user ((const char *) NULL
);
/* This data is part of a command. If there is no null
character in the data, this string will be continued by the
next packet. Otherwise this must be the last string in the
command, and we don't care about what comes after the null
znull
= (const char *) memchr (zfirst
, '\0', cfirst
);
fret
= ftadd_cmd (qdaemon
, zfirst
, (size_t) (znull
- zfirst
),
fret
= ftadd_cmd (qdaemon
, zfirst
, cfirst
, iremote
, FALSE
);
znull
= (const char *) memchr (zsecond
, '\0', csecond
);
fret
= ftadd_cmd (qdaemon
, zsecond
,
(size_t) (znull
- zsecond
), iremote
, TRUE
);
fret
= ftadd_cmd (qdaemon
, zsecond
, csecond
, iremote
, FALSE
);
if (pfexit
!= NULL
&& (qdaemon
->fhangup
|| qTremote
!= NULL
))
/* Get the transfer structure this data is intended for. */
if (q
== NULL
|| q
->precfn
== NULL
)
ulog (LOG_ERROR
, "Protocol error: %lu bytes remote %d local %d",
(unsigned long) (cfirst
+ csecond
),
/* If we're receiving a command, then accumulate it up to the null
znull
= (const char *) memchr (zfirst
, '\0', cfirst
);
znew
= zbufalc (q
->ccmd
+ cnew
+ 1);
memcpy (znew
, q
->zcmd
, q
->ccmd
);
memcpy (znew
+ q
->ccmd
, zfirst
, cnew
);
znew
[q
->ccmd
+ cnew
] = '\0';
if (! ftcharge (qdaemon
, q
, FALSE
, TRUE
))
if (! (*q
->precfn
) (q
, qdaemon
, zcmd
, ccmd
+ 1))
if (! ftcharge (qdaemon
, q
, FALSE
, FALSE
))
else if (! q
->frecfile
|| cfirst
== 0)
/* We're either not receiving a file or the file transfer is
if (! ftcharge (qdaemon
, q
, FALSE
, TRUE
))
if (! (*q
->precfn
) (q
, qdaemon
, zfirst
, cfirst
))
return fgot_data (qdaemon
, zsecond
, csecond
,
(const char *) NULL
, (size_t) 0,
ilocal
, iremote
, ipos
+ (long) cfirst
,
if (! ftcharge (qdaemon
, q
, FALSE
, FALSE
))
ulog (LOG_NORMAL
, "%s", q
->zlog
);
if (ipos
!= -1 && ipos
!= q
->ipos
)
DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO
,
"fgot_data: Seeking to %ld", ipos
);
if (! ffileseek (q
->e
, ipos
))
ulog (LOG_ERROR
, "seek: %s", strerror (errno
));
cwrote
= cfilewrite (q
->e
, (char *) zfirst
, cfirst
);
/* Check that there is still enough space on the
disk. If there isn't, we drop the connection,
because we have no way to abort a file transfer
cfree_space
= qdaemon
->qsys
->uuconf_cfree_space
;
&& ((q
->cbytes
/ FREE_SPACE_DELTA
)
!= (q
->cbytes
+ cfirst
) / FREE_SPACE_DELTA
)
&& ! frec_check_free (q
, cfree_space
))
ulog (LOG_ERROR
, "write: %s", strerror (errno
));
"Wrote %d to file when trying to write %lu",
cwrote
, (unsigned long) cfirst
);
/* Any write error is almost certainly a temporary
condition, or else UUCP would not be functioning
at all. If we continue to accept the file, we
will wind up rejecting it at the end (what else
could we do?) and the remote system will throw
away the request. We're better off just dropping
the connection, which is what happens when we
return FALSE, and trying again later. */
if (pfexit
!= NULL
&& qdaemon
->fhangup
)
/* Accumulate a string into a command. If the command is complete,
start up a new transfer. */
ftadd_cmd (qdaemon
, z
, clen
, iremote
, flast
)
cneed
= cTcmdlen
+ clen
+ 1;
zbuf
= (char *) xrealloc ((pointer
) zbuf
, cneed
);
memcpy (zbuf
+ cTcmdlen
, z
, clen
);
zbuf
[cTcmdlen
+ clen
] = '\0';
/* Don't save this string for next time. */
DEBUG_MESSAGE1 (DEBUG_UUCP_PROTO
,
"ftadd_cmd: Got command \"%s\"", zbuf
);
if (! fparse_cmd (zbuf
, &s
))
ulog (LOG_ERROR
, "Received garbled command \"%s\"", zbuf
);
if (s
.bcmd
!= 'H' && s
.bcmd
!= 'Y' && s
.bcmd
!= 'N')
ulog_user ((const char *) NULL
);
return fremote_send_file_init (qdaemon
, &s
, iremote
);
return fremote_rec_file_init (qdaemon
, &s
, iremote
);
return fremote_xcmd_init (qdaemon
, &s
, iremote
);
/* This is a remote request for a hangup. We close the log
files so that they may be moved at this point. */
q
= qtransalc ((struct scmd
*) NULL
);
q
->psendfn
= fremote_hangup_reply
;
return fqueue_remote (qdaemon
, q
);
/* This means a hangup request is being denied; we just ignore
this and wait for further commands. */
/* This is a remote confirmation of a hangup. We reconfirm. */
ulog (LOG_ERROR
, "Got hangup reply as master");
/* Don't check errors rigorously here, since the other side
might jump the gun and hang up. The fLog_sighup variable
will get set TRUE again when the port is closed. */
(void) (*qdaemon
->qproto
->pfsendcmd
) (qdaemon
, "HY", 0, iremote
);
ulog (LOG_FATAL
, "ftadd_cmd: Can't happen");
/* The remote system is requesting a hang up. If we have something to
do, send an HN. Otherwise send two HY commands (the other side is
presumed to send an HY command between the first and second, but we
don't bother to wait for it) and hang up. */
fremote_hangup_reply (qtrans
, qdaemon
)
struct stransfer
*qtrans
;
if (! fqueue (qdaemon
, (boolean
*) NULL
))
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
, "fremote_hangup_reply: No work");
fret
= ((*qdaemon
->qproto
->pfsendcmd
) (qdaemon
, "HY", 0, 0)
&& (*qdaemon
->qproto
->pfsendcmd
) (qdaemon
, "HY", 0, 0));
DEBUG_MESSAGE0 (DEBUG_UUCP_PROTO
, "fremote_hangup_reply: Found work");
fret
= (*qdaemon
->qproto
->pfsendcmd
) (qdaemon
, "HN", 0, 0);
/* As described in system.h, we need to keep track of which files have
been successfully received for which we do not know that the other
system has received our acknowledgement. This routine is called to
keep a list of such files. */
static struct sreceive_ack
*qTfree_receive_ack
;
usent_receive_ack (qdaemon
, qtrans
)
struct stransfer
*qtrans
;
if (qTfree_receive_ack
== NULL
)
q
= (struct sreceive_ack
*) xmalloc (sizeof (struct sreceive_ack
));
qTfree_receive_ack
= q
->qnext
;
q
->qnext
= qTreceive_ack
;
q
->zto
= zbufcpy (qtrans
->s
.zto
);
q
->ztemp
= zbufcpy (qtrans
->s
.ztemp
);
/* This routine is called by the protocol code when either all
outstanding data has been acknowledged or one complete window has
passed. It may be called directly by the protocol, or it may be
called via fgot_data. If one complete window has passed, then all
unmarked receives are marked, and we know that all marked ones have
uwindow_acked (qdaemon
, fallacked
)
register struct sreceive_ack
**pq
;
if (fallacked
|| (*pq
)->fmarked
)
(void) fsysdep_forget_reception (qdaemon
->qsys
, q
->zto
,
q
->qnext
= qTfree_receive_ack
;
/* This routine is called when an error occurred and we are crashing
out of the connection. It is used to report statistics on failed
transfers to the statistics file, and it also discards useless
temporary files for file receptions. Note that the number of bytes
we report as having been sent has little or nothing to do with the
number of bytes the remote site actually received. */
register struct stransfer
*q
;
/* Update the transfer times, but avoid looking in the queue. */
iTchecktime
= ixsysdep_process_time ((long *) NULL
);
(void) ftcharge (qdaemon
, (struct stransfer
*) NULL
, TRUE
, TRUE
);
(void) ftcharge (qdaemon
, (struct stransfer
*) NULL
, FALSE
, TRUE
);
if ((q
->fsendfile
|| q
->frecfile
)
ustats (FALSE
, q
->s
.zuser
, qdaemon
->qsys
->uuconf_zname
,
q
->fsendfile
, q
->cbytes
, q
->isecs
, q
->imicros
,
(void) frec_discard_temp (qdaemon
, q
);
if ((q
->fsendfile
|| q
->frecfile
)
ustats (FALSE
, q
->s
.zuser
, qdaemon
->qsys
->uuconf_zname
,
q
->fsendfile
, q
->cbytes
, q
->isecs
, q
->imicros
,
(void) frec_discard_temp (qdaemon
, q
);
/* When a local poll file is found, it is entered on the queue like
any other job. When it is pulled off the queue, this function is
called. It just calls fsysdep_did_work, which will remove the poll
file. This ensures that poll files are only removed if the system
flocal_poll_file (qtrans
, qdaemon
)
struct stransfer
*qtrans
;
fret
= fsysdep_did_work (qtrans
->s
.pseq
);