General Discuss anything and everything related to FlashFXP |
06-06-2003, 02:48 AM
|
#1
|
Junior Member
Join Date: Jun 2003
Posts: 5
|
Help from the programmers of FlashFXP
Maybe this is not the right place, since I know you have better things to do, but could you spend some moments and look after my little ftp client to see why it doesn't work ?
The problem is that sometimes it prints the LIST - ing of a directory and sometimes it doesn't.....
Could you tell me why?
The source code is in the attachment
I know you are busy people, but I also know you can help me, since your client FTP is very good, if not the best
P.S. of course my idea is not to create a commercial product to "steal" your buyers
|
|
|
06-06-2003, 02:58 AM
|
#2
|
Super Duper
FlashFXP Beta Tester
Join Date: Oct 2001
Location: Brooklyn, NY
Posts: 3,881
|
your code is in C++
FlashFXP is in Delphi
__________________
[Sig removed by Administrator: Signature can not exceed 20GB]
|
|
|
06-06-2003, 03:35 AM
|
#3
|
Junior Member
Join Date: Jun 2003
Posts: 5
|
Like Homer Simpsons would say....... DOH!
|
|
|
06-06-2003, 07:16 AM
|
#4
|
Junior Member
Join Date: Jun 2003
Posts: 5
|
At the moment, I have no time, but when I'll come back home, I'll explain what I do when I connect to the ftp, cause also if the programming language is not the same, the "mechanism" behind the client is the same
I hope you will answer me.
If you don't have time or you dfon't want to help me, plz tell me, also if i hope, you will help me
|
|
|
06-06-2003, 02:42 PM
|
#5
|
Junior Member
Join Date: Jun 2003
Posts: 5
|
Here is what my program do.
I hope the comments are enough for you, so you can help me
Code:
void ftp_passivelist (int *fd)
{
struct sockaddr_in server; // structure with the info taken from the PASV command (ip & port)
int p1 = 0, p2 = 0; // integer number containing the port numbers in the internert notation
int dataC; // socket used for the data connection
MakeSocket (&dataC); // initialization of the socket
memset (&server, 0, sizeof (server)); // nothing important
// used to take the ip and the port from the message returned by the PASV command
sscanf (buffer, "227 Entering Passive Mode (%d,%d,%d,%d,%d,%d)", &server.sin_addr.S_un.S_un_b.s_b1,
&server.sin_addr.S_un.S_un_b.s_b2,
&server.sin_addr.S_un.S_un_b.s_b3,
&server.sin_addr.S_un.S_un_b.s_b4,
&p1, &p2);
// just a debug print to see if the info correspond to the reply of the PASV command
printf ("--> (%d,%d,%d,%d,%d,%d)", server.sin_addr.S_un.S_un_b.s_b1,
server.sin_addr.S_un.S_un_b.s_b2,
server.sin_addr.S_un.S_un_b.s_b3,
server.sin_addr.S_un.S_un_b.s_b4,
p1, p2);
server.sin_port = htons ((p1 * 256) + p2); // the port number
server.sin_family = AF_INET; // nothing important
printf (" --> %d\n\n", (p1 * 256) + p2); // another debug print
send (*fd, "LIST \r\n", 7, 0); // send of the LIST command \r\n are the telnet end of line
// connecting to the port specified by the ftp server
if (connect (dataC, (struct sockaddr *)&server, sizeof (server)) < 0)
printf ("error connect");
GetReply (fd); // receive of the reply to the LIST command from the control connection
int a;
// this SHOULD be the receiving of the listing from the data connection and it's printing
while ((a = recv (dataC, buffer, sizeof (buffer), 0)) > 0)
{
printf ("%s", buffer);
}
// after i've received the lidting, I close the data connection
#if (defined (_WIN32) || defined (WIN32))
closesocket (dataC);
#else
close (dataC);
#endif
printf ("\n\n"); // nothing important
GetReply (fd); // receive of the reply to the LIST command after the receiving of the file
// listing
}
|
|
|
06-07-2003, 07:25 AM
|
#6
|
Junior Member
Join Date: Jun 2003
Posts: 5
|
Nevermind, now my program works
Sorry if I'have bothered you all
|
|
|
Thread Tools |
|
Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 01:07 AM.
|