C$SOCKET AGS-WRITE with Serv-U FTP Server v6.4 for WinSock doesn't work

0 Likes

Problem:

C$SOCKET with AGS-WRITE works with the Microsoft FTP Service but not when used with Serv-U FTP Server v6.4 for WinSock. The problem is in the command-string, as you can see in the example below, it describes that the string should end with the line feed character x"0A".

Example coding: -

if parse-command-code = "220"

   initialize unix-send-command

   move 1 to unix-send-cmd-length

   string "USER " delimited by size

             unix-username delimited by spaces

             x"0A" delimited by size

             into unix-send-command with pointer

             unix-send-cmd-length

   subtract 1 from unix-send-cmd-length

   call "c$socket" using Ags-Write,

                                     unix-connection -handle,

                                     unix-Send-Comma nd,

                                     unix-Send-Cmd-L ength

   call "c$socket" using Ags-Flush,

                                     unix-connection -handle

else

   go to all-tasks-complete-process

end-if.

Resolution:

To enable the command to work when used with Serv-U FTP Server v6.4 for WinSock and with the Microsoft Ftp Service the command-string must end with the carriage return and line feed characters x"0D0A".

Example coding: -

if parse-command-code = "220"

   initialize unix-send-command

   move 1 to unix-send-cmd-length

   string "USER " delimited by size

             unix-username delimited by spaces

             x"0D0A" delimited by size

             into unix-send-command with pointer

             unix-send-cmd-length

   subtract 1 from unix-send-cmd-length

   call "c$socket" using Ags-Write,

                                     unix-connection -handle,

                                     unix-Send-Comma nd,

                                     unix-Send-Cmd-L ength

   call "c$socket" using Ags-Flush,

                                     unix-connection -handle

else

   go to all-tasks-complete-process

end-if.

Old KB# 2782
Comment List
Anonymous
Related Discussions
Recommended