Closed
Bug 209972
Opened 22 years ago
Closed 22 years ago
Reduce FTP states
Categories
(Core Graveyard :: Networking: FTP, defect)
Core Graveyard
Networking: FTP
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: dougt, Assigned: dougt)
Details
(Keywords: perf)
Attachments
(1 file, 3 obsolete files)
35.35 KB,
patch
|
Details | Diff | Splinter Review |
I think we can remove two states (two round trips) from the FTP state machine.
CWD can be removed if we use the optional parameter path parameter of LIST
command. There is no need to have the login actually change directory. So:
CWD path
LIST
Becomes
LIST path
We can also remove PWD since everything should be determined by the path part
(+1) of the url. For example:
ftp://server.com/file - means get file in the CWD of the login
ftp://server.com//file - means get the file at /file
All paths should be relative to the CWD. There is no need to prepend the PWD to
any request. For example:
LIST <pwd>/file
Becomes
LIST file
Assignee | ||
Comment 1•22 years ago
|
||
first draft. I think I can also remove one more state - details later.
Comment 2•22 years ago
|
||
Comment on attachment 126038 [details] [diff] [review]
patch v.1
this patch makes sense to me. can we eliminate the code for the CWD state
then?
Assignee | ||
Comment 3•22 years ago
|
||
yeah, we can. I guess, i kept it cause i have (very) long time plans to make
ftp more controlable via some low level API. i guess we always have CVS for
history.
Assignee | ||
Comment 4•22 years ago
|
||
Remove SYST too.
Attachment #126038 -
Attachment is obsolete: true
Assignee | ||
Updated•22 years ago
|
Attachment #126070 -
Flags: superreview?(darin)
Attachment #126070 -
Flags: review?(bbaetz)
Comment 5•22 years ago
|
||
Comment on attachment 126070 [details] [diff] [review]
patch v.2
can you explain why we want to remove SYST as well?
Assignee | ||
Comment 6•22 years ago
|
||
of course...
SYST use to be used to determine how exactly to parse the LIST response. Some
time in 1.2 (iirc), we landed a new parser that can determine the LIST response
format solely based on the response -- there was no longer a need to know about
the server type. Today, it continues to be in the code because Colin's support
VMS (which is currently broken) depends on it. I spoke with Colin, and we think
we don't need the server type anymore to handle VMS. Since it is broken today,
we agreed to just nix it for now.
Comment 7•22 years ago
|
||
We can't do this, because we need to CWD each component separately, since we
don't nkow the path separator. Thats in theoryl in practice may be different.
Andreas?
Assignee | ||
Comment 8•22 years ago
|
||
we don't do that today. currently we just CWD <path>, then do a <LIST>.
Comment 9•22 years ago
|
||
I think we should try the patch against all those special fixed ftp bugs first.
There was a reason for the pwd-stuff if I remember correctly.
Assignee | ||
Comment 10•22 years ago
|
||
no doubt. this is a major change, much testing is required.
Comment 11•22 years ago
|
||
Could have been os2, perhaps?
Assignee | ||
Comment 12•22 years ago
|
||
Bradley, nope. for all server types, we issue complete paths to CWD. For
example ftp://example.com/blah/a/
will do this series of commands:
PWD
CWD <pwd result>/blah/a
LIST
This patch makes us do:
LIST blah/a
Comment 13•22 years ago
|
||
What is the goal of this? Is there some advantage to doing it this way?
Assignee | ||
Comment 14•22 years ago
|
||
faster ftp operations, of course.
Comment 15•22 years ago
|
||
Comment on attachment 126070 [details] [diff] [review]
patch v.2
>Index: nsFtpConnectionThread.cpp
> nsCAutoString mControlReadCarryOverBuf;
shouldn't this be a nsCString?
sr=darin
Attachment #126070 -
Flags: superreview?(darin) → superreview+
Assignee | ||
Comment 16•22 years ago
|
||
probably. figure i would leave it since I wasn't completely sure which was
better.
Comment 17•22 years ago
|
||
I asked dougt this question right before he was leaving for lunch so I'll pose
it here:
+ nsCAutoString listString;
+ if (mPath.Length() == 0)
+ listString = "LIST" CRLF;
+ else {
+ listString = mPath;
+ listString.Insert("LIST ",0);
+ listString.Append(CRLF);
+ }
For the above block, I'd use "IsEmpty" instead of "Length() == 0".
Also, I wondered why the else block is ordered that way. Wouldn't it be better
to assign "LIST " and then append path and crlf?
OS: Windows XP → All
Hardware: PC → All
Assignee | ||
Comment 18•22 years ago
|
||
I could use this:
nsCAutoString listString = "LIST";
if (!mPath.IsEmpty())
listString.Append(" ");
listString.Append(mPath);
}
listString.Append(CRLF);
Assignee | ||
Comment 19•22 years ago
|
||
and something that compiles:
nsCAutoString listString("LIST");
if (!mPath.IsEmpty()) {
listString.Append(" ");
listString.Append(mPath);
}
listString.Append(CRLF);
Assignee | ||
Comment 20•22 years ago
|
||
This fixes STOR to use the same path as RETR.
Attachment #126070 -
Attachment is obsolete: true
Comment 21•22 years ago
|
||
Comment on attachment 126567 [details] [diff] [review]
patch v.3
you might want to reorder these so mIPv6Checked and mSuspendCount are next to
each other:
+ PRUint8 mSuspendCount;// number of times we've been
suspended.
+ nsCOMPtr<nsIInputStream> mWriteStream; // This stream is written to the
server.
+ PRUint32 mWriteCount;
+ PRPackedBool mIPv6Checked;
Assignee | ||
Comment 22•22 years ago
|
||
yup. thanks.
Comment 23•22 years ago
|
||
Comment on attachment 126567 [details] [diff] [review]
patch v.3
This looks fine. Make sure to test file upload, as well as an os2 server.
Attachment #126567 -
Flags: review+
Updated•22 years ago
|
Attachment #126070 -
Flags: review?(bbaetz)
Assignee | ||
Comment 24•22 years ago
|
||
this adds back SYST state inorder to support colin's VMS patch.
Attachment #126567 -
Attachment is obsolete: true
Assignee | ||
Comment 25•22 years ago
|
||
Checked in:
Checking in nsFTPChannel.cpp;
/cvsroot/mozilla/netwerk/protocol/ftp/src/nsFTPChannel.cpp,v <-- nsFTPChannel.cpp
new revision: 1.129; previous revision: 1.128
done
Checking in nsFtpConnectionThread.cpp;
/cvsroot/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp,v <--
nsFtpConnectionThread.cpp
new revision: 1.259; previous revision: 1.258
done
Checking in nsFtpConnectionThread.h;
/cvsroot/mozilla/netwerk/protocol/ftp/src/nsFtpConnectionThread.h,v <--
nsFtpConnectionThread.h
new revision: 1.104; previous revision: 1.103
done
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment 26•22 years ago
|
||
I suspect this may be the cause of bug 211729
CWD path-to-symlink
LIST
is apparently different from
LIST path-to-symlink
- one lists the linked directory, the other shows the directory entry for the link.
Comment 27•22 years ago
|
||
From bug 212439, it sounds like this was backed out completely. Should it be
reopened?
Assignee | ||
Comment 28•22 years ago
|
||
reopened to mark as wontfix, if you really want to.
Updated•2 years ago
|
Product: Core → Core Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•