VxWorks 5.4 FTP Server problem - VxWorks

This is a discussion on VxWorks 5.4 FTP Server problem - VxWorks ; Hi, when I connect to my VxWorks target with a Windows FTP client application everything works fine putting files to the target. When I try to get a lot of files (more than 8-10) or a huge file (30-50 MB) ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: VxWorks 5.4 FTP Server problem

  1. VxWorks 5.4 FTP Server problem

    Hi,
    when I connect to my VxWorks target with a Windows FTP client
    application everything works fine putting files to the target. When I
    try to get a lot of files (more than 8-10) or a huge file (30-50 MB)
    from the target, the FTP server seems to stop working and my client
    application goes to timeout.

    It's an FTP known bug or have I a bad configuration?

    Thank You.


  2. Re: VxWorks 5.4 FTP Server problem

    Take a look at the vxworks faq - this seems to be a known bug (but with
    lots of smaller files). Are you running a patched version of the FTP
    server?

    Here's the FAQ...
    Q: When I send files to my target using FTP small files fail often, but
    larger don't have any problem at all.
    A: The following was written by Curt McDowell (csm@broadcom.com) in the
    newsgroup:

    I found a long-standing bug in VxWorks ftpLib that appears when
    transferring very small files from a relatively fast server to a
    relatively slow client.
    Once ftpLib has initiated a transfer, it calls select() on both the
    control and data connections. It expects the data connection to become
    ready first. If the control connection becomes ready first, it assumes
    an error, closes both file descriptors and returns ERROR.
    Unfortunately, it also assumes an error if the control and data
    connections become ready at the same time, which often happens in the
    conditions mentioned above.
    The fix is to change one line in ftpLib.c (in my case 392) from

    if (FD_ISSET (ctrlSock, &readFds))

    to
    if (FD_ISSET (ctrlSock, &readFds) && ! FD_ISSET (dataSock,
    &readFds))

    Apparently there was an SPR opened for this problem about 18 months ago
    by Paul Banta. Unfortunately nothing ever came of this. Thanks go to
    Paul Banta, who also experienced the problem and reported in.
    In the mean time, I have a version of the routine I call ftpXfer2()
    which has the same parameters as ftpXfer(). It does not contain any WRS
    code.
    In addition to fixing the small-file flaky transfer problem, it also
    fixes a bug prohibiting FTP_CONTINUE responses, which allows file
    renaming to work as follows (error checking omitted):
    int c_fd;

    if (ftpXfer2(host, user, pass, "", "RNFR %s", dir, file_oldname,
    &c_fd, NULL) == ERROR)
    ...

    if (ftpCommand(c_fd, "RNTO %s", (int) file_newname, 0,
    0, 0, 0, 0) != FTP_COMPLETE)
    ...

    (void) ftpCommand(c_fd, "QUIT", 0, 0, 0, 0, 0, 0);
    close(c_fd);

    And now for the code: ftpXfer2.c



    Federico wrote:
    > Hi,
    > when I connect to my VxWorks target with a Windows FTP client
    > application everything works fine putting files to the target. When I
    > try to get a lot of files (more than 8-10) or a huge file (30-50 MB)
    > from the target, the FTP server seems to stop working and my client
    > application goes to timeout.
    >
    > It's an FTP known bug or have I a bad configuration?
    >
    > Thank You.



  3. Re: VxWorks 5.4 FTP Server problem

    Instead of using ftp - where you always have to transfer the whole
    files, you may also want to check a CIFS SMB Windows File Sharing for
    VxWorks. (Like SAMBA on Unix).
    Then you can read or write blocks, dont need to transfer the whole
    files (better performance) and sockets dont remain open (lingering time
    of ftp-sockets) and if you have multiple accesses to the same file you
    dont have to worry about them.

    check with real-time-systems.com - they resell such a solution.

    GFL

    LarryC schrieb:

    > Take a look at the vxworks faq - this seems to be a known bug (but with
    > lots of smaller files). Are you running a patched version of the FTP
    > server?
    >
    > Here's the FAQ...
    > Q: When I send files to my target using FTP small files fail often, but
    > larger don't have any problem at all.
    > A: The following was written by Curt McDowell (csm@broadcom.com) in the
    > newsgroup:
    >
    > I found a long-standing bug in VxWorks ftpLib that appears when
    > transferring very small files from a relatively fast server to a
    > relatively slow client.
    > Once ftpLib has initiated a transfer, it calls select() on both the
    > control and data connections. It expects the data connection to become
    > ready first. If the control connection becomes ready first, it assumes
    > an error, closes both file descriptors and returns ERROR.
    > Unfortunately, it also assumes an error if the control and data
    > connections become ready at the same time, which often happens in the
    > conditions mentioned above.
    > The fix is to change one line in ftpLib.c (in my case 392) from
    >
    > if (FD_ISSET (ctrlSock, &readFds))
    >
    > to
    > if (FD_ISSET (ctrlSock, &readFds) && ! FD_ISSET (dataSock,
    > &readFds))
    >
    > Apparently there was an SPR opened for this problem about 18 months ago
    > by Paul Banta. Unfortunately nothing ever came of this. Thanks go to
    > Paul Banta, who also experienced the problem and reported in.
    > In the mean time, I have a version of the routine I call ftpXfer2()
    > which has the same parameters as ftpXfer(). It does not contain any WRS
    > code.
    > In addition to fixing the small-file flaky transfer problem, it also
    > fixes a bug prohibiting FTP_CONTINUE responses, which allows file
    > renaming to work as follows (error checking omitted):
    > int c_fd;
    >
    > if (ftpXfer2(host, user, pass, "", "RNFR %s", dir, file_oldname,
    > &c_fd, NULL) == ERROR)
    > ...
    >
    > if (ftpCommand(c_fd, "RNTO %s", (int) file_newname, 0,
    > 0, 0, 0, 0) != FTP_COMPLETE)
    > ...
    >
    > (void) ftpCommand(c_fd, "QUIT", 0, 0, 0, 0, 0, 0);
    > close(c_fd);
    >
    > And now for the code: ftpXfer2.c
    >
    >
    >
    > Federico wrote:
    > > Hi,
    > > when I connect to my VxWorks target with a Windows FTP client
    > > application everything works fine putting files to the target. When I
    > > try to get a lot of files (more than 8-10) or a huge file (30-50 MB)
    > > from the target, the FTP server seems to stop working and my client
    > > application goes to timeout.
    > >
    > > It's an FTP known bug or have I a bad configuration?
    > >
    > > Thank You.



+ Reply to Thread