Page 1 of 1

Who made this stack?

Posted: Tue Jul 09, 2013 2:17 am
by Nakia
Hi,

I have attached the beginnings of a FTP Server that someone began to create.
I am trying to track this person down to ask a few questions as I would like to finish it off and move it over the iOS (using mergSockets)

Realise this is a long shot...

Re: Who made this stack?

Posted: Tue Jul 09, 2013 6:31 am
by Nakia
I have been tinkering with this today trying to piece in the other peices to get ACTIVE Mode working (and the rest of what is required for PASSIVE Mode)

I have hit a stumble with trying to read all of the data of the ACTIVE MODE PORT REQUEST message that is sent from the FTP Client.
I am using the below to catch the PORT Request for ACTIVE Mode from the Client but when I process the pMsg I am only getting the line highlighted in the attached screen capture..

EDIT: Reading through the dictionary tells me without having a "until" in the socket read command that it will recieve the FIRST char only. so I tried using a "read from socket until "Active port" with message r0" in the handler below but it just doesnt seem to stop reading... can anyone suggest a more appropriate until statement.

I could provide the Packet Captures if that help anyone?

on r7 TheIP, pMsg --ACTIVE
put "Request 4 Port Active -" && pMsg after fld "log"
write "200" & crlf to socket theIP -- Acccept Connection
read from socket theIP with message r0
end r7



if pMsg contains "PORT" then
put pMsg into fld tFld
put false into xferpasv
r7 TheIP,pMsg
exit r0
end if

I need to be able to read the portion from the message "Active port: xxxxx" so I can use that in my subsequent message back to the Client.

Re: Who made this stack?

Posted: Tue Jul 09, 2013 2:10 pm
by Klaus
Hi Nakia,

can't you:
...
read from socket theIP for 4 lines
## and then check if line 4 begins with "Active port:"
## But maybe this is not "standard" input?
...


Best

Klaus

Re: Who made this stack?

Posted: Tue Jul 09, 2013 10:25 pm
by Nakia
Hi Klaus,

Thanks for your reponse.
I think you are correct but I am yet to give that a shot. I see this working in this regard but what I am unsure about following this is
what I should do to esnure I read all the BIN data once I get the stack to start accepting the transferring the data.

From my testing so far the Windows FTP Client doesn't tell the server the SIZE of the file before attempting to send it so I am struggling with how I would
successfully complete the read when the actual BIN data begins to transfer.

Anyway, Im gunna keep ticking away at it..
small steps!!!

Re: Who made this stack?

Posted: Tue Jul 09, 2013 10:50 pm
by shaosean

Code: Select all

read from socket theIP until CRLF
All commands sent from the client MUST end with CRLF so read until that sequence of characters and you will have a complete command and parameters (if any).. If you need any help with the FTP protocol, feel free to post on here or email me directly < support AT shaosean DOT tk >

Re: Who made this stack?

Posted: Tue Jul 09, 2013 11:17 pm
by Nakia
Hi,

I will send you an email.
Tried reading for x lines and read until CRLF but I still just cant get that data
(I have a theory however)

Re: Who made this stack?

Posted: Wed Jul 10, 2013 2:06 am
by Nakia
Email sent..

Will keep this thread updated as it progresses