[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with ftp_put()



M.Effenberg@xxxxxxxxxxxx wrote:
> hi all,
> i have a problem with the ftp_put() procedure.
> When I call it, the program just terminates without a message.
[SNIP]
 > In the second cycle Rreadn() within rf_read() fails somehow and the
 > program completely quits.
 >


I can't see (from the info you've given) why it would just terminate 
without a message.   The rf_read() procedure (or "read_data") returns 
the length of the data it read.

In put_block(), when that number of bytes is < 1 (i.e. there's no data 
to send to the FTP server) it jumps out of the put_block() routine, 
since there's no data left to send to the FTP server.  In other words, 
everything has been sent, the file transfer is complete.

It then proceeds (in FTP_putraw(), who calls put_block() to begin with) 
to get the FTP server's reply to verify that the file was received 
successfully, and returns control to your program to let you send more 
FTP commands.

So, it doesn't terminate the program!  It just stops sending the file 
because there's nothing to send.  Perhaps there's some other error 
that's happening afterward that you didn't mention in your e-mail?

In your RPG code (that you provided) you have this:

c                   if        ftp_put(fd: zzfile: zzlnam) < 0
c                   eval      Msg = ftp_errorMsg(fd)
c                   callp     ftp_quit(fd)
c                   goto      eget
c                   endif

Basically the way you've coded it, if an error occurs, the error message 
is stored into the variable named "Msg" but nothing else is done with 
it?  Do you ever display it on the screen, or log it to a file or 
anything like that?

The fact that there's no further entries in your job log makes me think 
that the server is disconnecting you.  Otherwise, it would show the 
reply from the server, and the QUIT command being sent from FTPAPI, 
neither of which show up (at least, not in the e-mail you sent.)

If the server is disconnecting, there should be a message in the "MSG" 
variable of your program that tells you what happened.  Have you looked 
at it?
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------