Closed Bug 22299 Opened 25 years ago Closed 21 years ago

FTP support for VMS

Categories

(Core Graveyard :: Networking: FTP, defect, P3)

All
OpenVMS
defect

Tracking

(Not tracked)

VERIFIED FIXED
Future

People

(Reporter: jud, Assigned: colin)

References

()

Details

(Keywords: regression, relnote, testcase)

Attachments

(1 file, 9 obsolete files)

Target Milestone: M14
Severity: normal → enhancement
Status: NEW → ASSIGNED
Target Milestone: M14 → M20
I'm pushing this off as an RFE. Jim, does IBM need this?
I asked and never got a response... so from my end, don't worry
about it
*** Bug 27979 has been marked as a duplicate of this bug. ***
robert-- welcome to necko!
Assignee: valeski → rjc
Status: ASSIGNED → NEW
->nobody.
Assignee: rjc → nobody
Keywords: helpwanted
Target Milestone: M20 → Future
mass move, v2.
qa to me.
QA Contact: tever → benc
If this is 4xp parity, someone please let me know.
Component: Networking → Networking: FTP
Summary: Need VMS FTP support → [RFE] VMS FTP support
as scary as it is... it is.
Keywords: 4xp
this may be causing a crash... move to my plate to investigation.
Assignee: nobody → dougt
Target Milestone: Future → ---
Target Milestone: --- → Future
This would be something easy to pump out given the time.  
Can I ask a silly question?

Why is this so hard to support given that all the code to 
do it is in mkftp.c in 4.x?
Mike, no one ever said it was hard.  The problem is time.  Feel free to submit a
patch.
and a VMS host (or a qa contact:)
*** Bug 84472 has been marked as a duplicate of this bug. ***
Summary: [RFE] VMS FTP support → VMS FTP support
Target Milestone: Future → mozilla1.0
Info from our TCP/IP team about why Mozilla can't connect to an OS/2 FTP 
server. Might be relevant to the OpenVMS problem:

How Netscape V4.6 works:
After the initial logon sequence Netscape V4.6 client issues a SYST command and 
waits for the server to respond back with its Operating System details.  Then 
the client issues a command "PASV" for the passive connection. The server 
responds back with its new port number for data connection.At this point of time 
 a handshake takes place between the client and the server over the data ports. 
Later when the client issues a "NLST" command to list the directory , the data 
flows from the new data connection already established between the client and 
the Server.

How Netscape V6 works:

After the initial logon sequence  Netscape V6.0 client issues a SYST command and 
waits for the server to respond back with its Operating System details.  Then 
the client issues a command "PASV" for the passive connection. The server 
responds back with its new port number for data connection. Here there is a 
change in the way the client responds . The client does not establish a data 
port connection here but just stores the Server port numbers for later use.  
Later when the client issues a "NLST" command to list the directory , it 
suddenly issues a SYN to the Server port number that it had initially stored and 
tries establishing a data port connection. 
 
The difference is that Netscape V4.6 establishes a data port connection just 
after receiving the Server port number after the client issues "PASV" command. 
But Netscape V6.0 does not establish a connection at that point of time but 
waits till it sends a command to list the directory.

The Command that Netscape client sends to OS/2 to list the directory is "NLST" . 
The client should send a SYN just after issuing "NSLT" command which it does not 
do. The client should initiate the connection form his side.
Netscape V6.0 works fine with Linux, AIX and Windows because the command that it 
uses to list the directory is " LIST" instead of "NLST" for OS/2.  And in case 
of other Operating Systems it issues a SYN immediately after sending a "LIST"  
which it does not do after "NLST".

We changed our code to see it our above understanding was correct or not. What 
we did was when the client issues a SYST request , instead of sending the 
Operating system string as OS/2 we forced out code to send the OS as 
Windows/UNIX . The directory listing came up properly when we said the OS was 
Windows. In this case after the "LIST" command Netscape 6.0 did send a SYN to 
establish a connection.
More info after working with doug on this.

We added OS/2 to the check in R_syst and set it to FTP_NT_TYPE.

From here, we could FTP to subdirectories on the server if we knew them, but we 
got "You are not authorized to see the "/" directory" if we tried to login with 
just the hostname (no subdir)

Once I got listings up from a subdir, they were parsed incorrectly for display. 
I was able to fix this by using NLST instead of LIST in S_list.

I tried making the VMS ftp server behave as NT, but it just crashed the browser. 
Looks like we have list parsing issues.
mkaply: see bug 84242. Could that be related?
reassigning to bbaetz@cs.mcgill.ca.
Assignee: dougt → bbaetz
*** Bug 100812 has been marked as a duplicate of this bug. ***
server URL from dupe:
ftp://ftp.montagar.com
Summary: VMS FTP support → [RFE] FTP support for VMS
RELNOTE for 6.2:
FTP does not work with most VMS servers in this release.
Keywords: relnote
testcase:
site from another dupe: ftp://kuhub.cc.ukans.edu/

There was a better error dialog in Bug 84472. What do I need to do to get it 
in? If we put that in, I can get rid of yet another release note entry.
Keywords: testcase
->future, +helpwanted
Target Milestone: mozilla1.0 → Future
OS: Windows NT → All
Blocks: 101002
*** Bug 134085 has been marked as a duplicate of this bug. ***
*** Bug 138278 has been marked as a duplicate of this bug. ***
cc: myself, we just got in a bug report saying that ftp publish does not
work for OpenVMS.
I can fix this one. I'd have fixed it ages ago if I'd seen it. Why wasnt' the OS
set to OpenvMS!!!!
OS: All → OpenVMS
because you get the error messages on all Platforms if you connect to an openVMS 
server ?
Probably because its not the client which is openvms, but the server - it
affects all client OSs

Publish should be easy - I have a bug on me to clean up when we pop up the
'don't support Foo' dialog, since what it really means is 'don't support
directory listings', and so we could publish, and even see the results
afterwards. Once that is fixed, publish shoulw just work.

There are a lot of vms hacks in the old mozclassic code to deal with this - even
ncftp won't handle the <n>;name style of names. OTOH, this is probably easier
since I changed the backend to support a displayed name different to the
viewable name.
If you can let me know what needs fixing for publish to work, I'll start with 
that. Then for directory listing to work we need some code to parse a VMS server 
directory listing, is that the deal?
In the ftp state machine in nsFtpConnectionThread.cpp, move the call to send
SYST to just before we do a CWD in preparation for LIST.

ie replace FTP_S_CWD with FTP_S_SYST, and FTP_S_SYST with FTP_S_PWD. Then change
teh error message to reflect tha this only affects directory listings.

I know I've mentioned doing this in a bug, somewhere, but I can't find it.

Either file a new bug, or use bug 95590, I guess. Probably a new one.

Its reaonably easy to add a new type to be parsed - check out
netwerk/streamconv/converters/nsFTPDirListingConv.{cpp,h}
Whiteboard: verify 138278 after this is fixed.
Navigator V3 and V4 both had support for OpenVMS FTP servers. Of course, not 
being at Netscape/AOL at the moment I don't have access to this code. But this 
is what I need in Mozilla!!

What's the best way to go about getting this existing code into Mozilla? 
Shipping 1.0 without it is a regression.
Here is the code:

http://lxr.mozilla.org/classic/source/network/protocol/ftp/mkftp.c

It was contributed to Mozilla.
Attached patch Basic support for VMS FTP server (obsolete) — Splinter Review
This problem was worse than I thought. Not only couldn't I publish, but I
couldn't even download a file via FTP.

The patch provides basic support for a VMS FTP server. With this I can publish
and download files from a VMS FTP server. What I can't do yet is "browse" via
FTP (ie. get directory listings). I believe I need to write a stream converter
for this, but don't have time right now. So instead of the
"scs->AsyncConvertData failed" message, for now I have prevented it from even
trying the RETR on the dirspec, and so a 550 error is displayed. This seems a
reasonable temporary measure.

I'm leaving for vacation tonight and won't be back until the middle of next
week. I'd REALLY like to get this into RC2 so I'd appreciate some reviews. And
if some kind soul would like to check it in perhaps......
Do we have to have the VMS-fu everywhere? I suppose so...

See my comment 30 for how to provide a better error for directory listings. Oh.
I just realised that that won't work, since you have to care about the type when
converting the file. Bleh. There goes that iea, I think. Is that correct?
Who owns the FTP code? I'd like to get a review.
Bradley does.  If he is too busy, ask him to delegate.
That would sort of be me - see my comment #34 + questions, though. Is there a
cleaner way to do this?
I thought you answered your own questions in 34 :-)
Well, I was mainly musing, true.
Is there no way to get a vms server to, when asked for the contents of a
directory, give file names which actually are the names of files we can use for
RETR/LIST?
This patch isn't dealing with directory formats; that work will require a stream 
converter (and no, you can't get an OpenVMS FTP server to generate "UNIX output" 
(I believe the spec says the output is platform specific so we're not broken)). 
This patch is just dealing with uploading files.
Comment on attachment 80790 [details] [diff] [review]
Basic support for VMS FTP server

r=bbaetz. Yeah, the ftp spec's lack of requirements about most things is a real
pain...
Attachment #80790 - Flags: review+
Comment on attachment 80790 [details] [diff] [review]
Basic support for VMS FTP server

``looks clear'' sr=scc
Attachment #80790 - Flags: superreview+
colin: Do you have cvs access, or do you want me to check this in?
Bradley: I have CVS access, but I'm still waiting for driver approval for 1.0 
branch checkin (I sent mail the other day). I guess it could go into tip now, 
only I don't have a tip tree I'm building at the moment. Could you check it in 
to tip, or I'll do it in a day or two.
Let's get this into trunk NOW.  No reason to wait for branch approval, which may
not come anyways, plus anything baked in trunk is considered more stable for
branch inclusion.
I don't have a trunk build at the moment, so I can't make this change right now.
In a few days when I have an up to date trunk build I'll merge in my changes and
submit a new patch (the FTP code has changed).
-> patch author

colin: I don't have time this week to merge this stuff, sorry.
Assignee: bbaetz → colin
Well, the branch has changed too since I made my patch, so I've merged and will
be testing a new patch once my build is done (tomorrow). Branch and trunk now
differ by only an nsUnescape/NS_Unescape call - off to track down the difference.
The 1.0 branch code in nsFtpConnectionThread.cpp has been modified since I
posted patch 80790. This is an updated version of the previous patch.
Attachment #80790 - Attachment is obsolete: true
Attached patch Patch for trunk (obsolete) — Splinter Review
Here's a patch for the trunk. I only have a branch build environment at the
moment so I'm unable to test this patch, but if some kind soul could test it
and check it in, that'd be great.
*** Bug 151501 has been marked as a duplicate of this bug. ***
Attached patch Same patch but for current trunk (obsolete) — Splinter Review
Sorry for the delay on this. I finally have a trunk build that I've been able
to test this fix with. I'm attaching a revised patch but it should be the same
as the provious one.

Since its been a few weeks do I need to get the r=bbaetz and sr=scc re-issued
or can I just go ahead and check in?
Attachment #83027 - Attachment is obsolete: true
Checked in patch 87923 for initial publish support in OpenVMS.
Summary: [RFE] FTP support for VMS → FTP support for VMS
Mozilla 1.2.1, Mac OS X

I see errors w/ a "550" now.

Is this a regression of the "unsupported dialog" or some change you might have made?
This is connecting to an FTP server on an OpenVMS system?
Yes, I'm using the link in the URL field.
The site does still work, I can log in manually:

USER anonymous
331 anonymous user ok. Send real ident as password.
PASS foo@
230-Guest User FOO@ logged into DUA8:[ANON_FTP] at Fri 6-Dec-2002 5:01PM-CST,
job 17e828.
230 Access restrictions apply
PWD
257 "DUA8:[ANON_FTP]" is current directory.
What do you get back from a SYST command?
215 VMS MultiNet V4.4(91)
There are at least two problems: first there is a bug in our R_retr handler such
that any VMS listings will fail if RETR fails.  Colin, are you sure we need that
check?  The second problem is that ConvertDirspecToVMS is incorrectly inserting
a . at offset 1 in the dirSpec (colin: i could be wrong about that -- i would
never claim to be a VMS filepath expert).

*** Bug 202387 has been marked as a duplicate of this bug. ***
We are about to ship Mozilla 1.4f with a regression vs. Mozilla 1.0.2, where we
give a reasonable error message when connecting to VMS sites.

Is this okay? If implementing VMS directory parsing is not going to happen, we
should back out whatever regressed that friendly dialog box.
+regression from dupe.
Keywords: regression
I believe this patch (for the 1.5 tip) provides full FTP support for OpenVMS
servers. At least it does in my testing of surfing around FTP urls on an
OpenVMS server, and in publishing via ftp to an OpenVMS server.

Looking for some reviews.
Attachment #83025 - Attachment is obsolete: true
Attachment #87923 - Attachment is obsolete: true
Comment on attachment 126836 [details] [diff] [review]
Patch for full support on OpenVMS

I was hoping to avoid using the SYST (and mServerType).  Is this possible?
I guess if we're still always doing a PWD at the start of a session, we could
look to see if the returned working directory string is VMS format (search for
":["). That would probably work, but its kinda hacky.
I don't want to use PWD either. See 209972.  
Attachment #126836 - Attachment is obsolete: true
Comment on attachment 126930 [details] [diff] [review]
OpenVMS patch for Doug's new code

stay away from the string "fileSpec".  This bring back memories of the
nsFileSpec class which is obsolete.  s/fileSpec/fileString/g  if possible.


+    if (mServerType == FTP_VMS_TYPE) {
+	 if (!mPath.IsEmpty()) {
+	     ConvertDirspecToVMS(listString);
+	 }
+	 listString.Append(";0");
+    }

Can you have ConvertDirspecToVMS handle empty strings?

     return SendFTPCommand(listString);
+
 }

kill that blank line.

you have some printf's still in this patch.


how much of these functions are new - or - are they just being readded after my
removal?

+    void ConvertFilespecToVMS(nsCString& fileSpec);
+    void ConvertDirspecToVMS(nsCString& fileSpec);
+    void ConvertDirspecFromVMS(nsCString& fileSpec)

why the changes in ParseFTPList.cpp?  We should run these by
cyp@fb14.uni-mainz.de.
Colin's changes to ParseFTPList.cpp are to
a) obtain filesize for listings served by Multinet hosts 
   (num_blocks->filesize conversion by multiplying num_blocks by 512).
b) force non-Multinet hosts (CMU/VMS-IP FTP and older UCX FTP) to 
   use the same filesize conversion as that used for Multinet.

The original code didn't make this conversion (it returned size=""),
because, first, I wasn't sure whether blocksize was always 512; 
second, I was of the opinion that presenting no filesize was 
better than presenting an inaccurate filesize (too large);
third, ftpmirror and squid didn't list a filesize either. 

I have no idea how prevalent such non-Multinet FTP servers are, but I took
that possibility into account at time of writing. Current versions of UCX FTP
serve listings in ls -l style (eg ftp.service.digital.com), so this issue is
moot for them.

(According to Lynx) non-Multinet FTP listings can also be in <bytes>/<blocks> 
or in <used>/<allocated> format. This may be wrong. But if it isn't, Colin's
patch will break listings with the former format.

Even if using _only_ the blocksize format (incidentally, Colin's "#if 0" is 
two lines too low), the conversion needs review. 
a) the conversion needs to consider that the resultant filesize can 
   be larger than a 32bit int, so Colin's code isn't right. 
   And of course, sprintf() isn't NSPR, even if we were to use
   "%llu" instead of "%d". :)
b) retrieving will result in a file that will be "too short" (as 
   compared to the displayed filesize). I don't think anyone will 
   actually compare filesizes, so this is ok IMO, but perhaps it 
   ought to be discussed anyway - someone may have an idea how 
   to obtain a more accurate filesize. 

With respect to determining if the server is a VMS server or not:
You can avoid the use of SYST and PWD by checking the list_state->lstyle 
member on successful return from ParseFTPList(). It will be 'V' for VMS listings.


> stay away from the string "fileSpec".  This bring back memories of the
> nsFileSpec class which is obsolete.  s/fileSpec/fileString/g  if possible.

Done.

> Can you have ConvertDirspecToVMS handle empty strings?

Yes. Done.

> kill that blank line.

Done.

> you have some printf's still in this patch.

Not any more :-)

> how much of these functions are new - or - are they just being readded
> after my removal?
>
> +    void ConvertFilespecToVMS(nsCString& fileSpec);
> +    void ConvertDirspecToVMS(nsCString& fileSpec);
> +    void ConvertDirspecFromVMS(nsCString& fileSpec)

ConvertFilespecToVMS was there before, but I've pretty much rewritten it to make
it work in all cases.

ConvertDirspecToVMS was there before but didn't work too well. I've made it now
use ConvertFilespecToVMS.

ConvertDirspecFromVMS I have removed since it was only needed to convert what
came back from the PWD command.

> why the changes in ParseFTPList.cpp? 

The OWNER test I removed because it was looking for something in the format
"[UIC]" but now we can also have an identifier as the owner (which doesn't have
the [] around it) or a hexadecimal string. Testing for all these different owner
formats would be a pain, so I removed it.

The SIZE change is explained by the comments. The SIZE always comes back in
blocks and a block is always 512 bytes.

The DATE change was needed because we were passing in years such as 02 and 03,
and NSPR wants four digits such as 2002 and 2003.
Cyrus:

> The original code didn't make this conversion (it returned size=""),
> because, first, I wasn't sure whether blocksize was always 512; 
> second, I was of the opinion that presenting no filesize was 
> better than presenting an inaccurate filesize (too large);
> third, ftpmirror and squid didn't list a filesize either. 

The filesize is always going to be a multiple of 512 and will therefore be
slightly high most of the time. But I figured its better to tell someone that a
file is 1K or 100MB, even if it is off by a few bytes.

> I have no idea how prevalent such non-Multinet FTP servers are, but I took
> that possibility into account at time of writing. Current versions of UCX FTP
> serve listings in ls -l style (eg ftp.service.digital.com), so this issue is
> moot for them.

UCX is probably more common than Multinet and the rest, these days.

UCX doesn't list in "ls -l" format (ftp.service.digital.com is a UNIX FTP server!!).

> (According to Lynx) non-Multinet FTP listings can also be in <bytes>/<blocks> 
> or in <used>/<allocated> format. This may be wrong. But if it isn't, Colin's
> patch will break listings with the former format.

I have never seen anything other than <used>/<allocated> 
> With respect to determining if the server is a VMS server or not:
> You can avoid the use of SYST and PWD by checking the list_state->lstyle 
> member on successful return from ParseFTPList(). It will be 'V' for VMS
> listings.

No can do. You don't get a successful return from ParseFTPList() until you've
passed a valid LIST command to the server, and for OpenVMS this needs to be in
OpenVMS format. Chicken and egg....
The three main (almost only) FTP servers on VMS these days are:
  - TCP/IP Services for OpenVMS (UCX)
  - Multinet
  - TCPware

These are the three I have been testing with this morning.

I found that TCPware puts 1/100th seconds on the timestamp, so I had to change
the parser to allow for that.

Multinet does a UNIX emulation these days, so the VMS code isn't even involved.

I'll post a new patch next.

By the way, I found a BSD system that doesn't work with the new scheme. Doug,
can you try ftp://ftp.digital.com/ and see if it works for you. For me it just
hangs.
Attachment #126930 - Attachment is obsolete: true
I would like to get this checked in to the trunk. The sooner its in the more
testing it will get and it would appear that we've already missed the 1.5a boat.
Its got to be better than what's currently in Mozilla (no support at all) and we
can fix bugs as they are found.
Comment on attachment 127353 [details] [diff] [review]
Incorporate feedback and add support for TCPware.

+	 ConvertDirspecToVMS(listString);
+	 listString.Append(";0");

Can't ConvertDirspecToVMS append the ";0"?

Maybe you should just fixup the mPath in one place, such as nsFtpState::Init? 
I am not sure if you can do this, but it sure would be cleaner.

The ParseFTPList code -- maybe we should just intergrate the latest version?
> Can't ConvertDirspecToVMS append the ";0"?

Sure, I can do that.

> Maybe you should just fixup the mPath in one place, such as nsFtpState::Init? 
> I am not sure if you can do this, but it sure would be cleaner.

Problem is that we don't know how to convert mPath (file or directory) until we
know what we are doing with it.

> The ParseFTPList code -- maybe we should just intergrate the latest version?

You mean Cyrus' latest round of changes? I'd prefer to get in the basic "make it
work" changes I've made, which I've tested with, and then move on to Cyrus'
changes. 
I'd agree if we hadn't already missed the boat. Otherwise, I'd prefer we used 
the latest version since it requires changes to nsFTPDirListingConv as well 
for the VMS long filename handling, and are as such part of the VMS fix set.

I'll post a new patch which includes Cyrus's changes, but people will have to
realize that this patch now includes more than just OpenVMS support.
We've missed the 1.5a boat, so once 1.5a is out and I'm building 1.5 trunk again
I'll resubmit my patches based on the current FTP code since things seemed to
change since my previous set of patches.

Doug, sorry to hear that you got hit by last weeks hatchet attack. Are you still
going to be involved in this FTP code?
thanks - i was lucky.  I still will be involved as much as I can be.  
Attached patch Patch for trunk (obsolete) — Splinter Review
I finally got some time to get back to this. Gee, the trunk has changed since
my previous patch! Anyway, this patch is for the current 1.5 trunk. Built and
tested on OpenVMS.

Cyrus, this patch doesn't contain your latest changes because I view your work
as separate from mine. Once my changes are in I'll be more than happy to help
you get yours checked in too. I think two smaller checkins is easier to manage
than one big one.

Now, who can review this for me? I don't want to miss the 1.5b boat too :-)

Colin (who is out until next Wednesday).
Attachment #127353 - Attachment is obsolete: true
Attachment #129030 - Flags: review?(bbaetz)
Comment on attachment 129030 [details] [diff] [review]
Patch for trunk

suppose i have a quote '"' in a file, on non VMS servers, can i still FTP retr
it?


+    p = strdup(fileString.get());

what if this fails?


+#if 0
+     

comment why this is ifdef off.

What kind of testing has been done?
> suppose i have a quote '"' in a file, on non VMS servers, can i still
> FTP retr it?

Unrelated to this patch. All my code is purely for VMS servers.

> What kind of testing has been done?

Tested against TCP/IP Services for OpenVMS (formerly UCX), TCPware, and
Multinet. These are the three major IP stacks available for OpenVMS.

I'll fix the other things and repost the patch.
Comment on attachment 129030 [details] [diff] [review]
Patch for trunk

in R_pwd(), you are now checking for " in the response.  unless, i am missing
something :-), i think my question is spot on.
Comment on attachment 129030 [details] [diff] [review]
Patch for trunk

in R_pwd(), you are now checking for " in the response.  unless, i am missing
something :-), i think my question is spot on.
> in R_pwd(), you are now checking for " in the response.  

That test for " was always there. I haven't added it.
Comment on attachment 129030 [details] [diff] [review]
Patch for trunk

r=dougt
Attachment #129030 - Flags: superreview?(darin)
Attachment #129030 - Flags: review?(bbaetz)
Attachment #129030 - Flags: review+
Attached patch Incorporate Doug's comments (obsolete) — Splinter Review
Doug, this version of the patch doesn't use strdup and has better comments
explaining why a section of code is ifdef'd out. Can you take a look and then
carry forward your r= from the previous patch. Thanks.
Attachment #129030 - Attachment is obsolete: true
Adding 1.5b flag. Originally I tried to get this into 1.5a but failed because
the FTP code was a moving target. If I don't get it in for 1.5b then I probably
won't be allowed to check it in for 1.5 final, and that'll likely mean we'll
never seen FTP support for OpenVMS in Mozilla "the suite".
Status: NEW → ASSIGNED
Flags: blocking1.5b?
Comment on attachment 129437 [details] [diff] [review]
Incorporate Doug's comments

>Index: netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp

>     retrStr.Insert("RETR ",0);

nit: add whitespace between function arguments.  this nit
applies to entire patch.. i see a lot of places where this
should be cleaned up to match existing style.


>+    t = strtok((char *)fileStringCopy.get(),"/");
>+    if (t) while (strtok(NULL,"/")) ntok++; // count number of terms (tokens)
...
>+            fileString.Append(strtok(NULL,"/"));

strtok should never be used because it is not re-entrant safe,
and mozilla may be used in a multithreaded environment.  e.g.,
someone could even spawn more than one gecko instance on its
own primordial thread in the same address space.  please use
nsCRT::strtok instead.


> nsFtpState::ConvertDirspecToVMS(nsCString& dirSpec)
> {
>+    PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x) ConvertDirspecToVMS from: \"%s\"\n", this, dirSpec.get()));
>+    if (!dirSpec.IsEmpty()) {
>+        if (dirSpec.Last() != '/') dirSpec.Append("/");

nit: insert line break here...

	  if (dirSpec.Last() != '/')
	      dirSpec.Append('/');

>+        // we can use the filespec routine if we make it look like a file name
>+        dirSpec.Append("x");

nit:	  dirSpec.Append('x');


>+nsFtpState::ConvertDirspecFromVMS(nsCString& dirSpec)
>+{
>+    PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x) ConvertDirspecFromVMS from: \"%s\"\n", this, dirSpec.get()));
>+    if (dirSpec.IsEmpty()) {
>+        dirSpec.Insert(".",0);
>+    }
>+    else {
>+        dirSpec.Insert("/",0);
>+        dirSpec.ReplaceSubstring(":[","/");
>+        dirSpec.ReplaceChar('.','/');
>+        dirSpec.ReplaceChar(']','/');
>+    }
>+    PR_LOG(gFTPLog, PR_LOG_DEBUG, ("(%x) ConvertDirspecFromVMS   to: \"%s\"\n", this, dirSpec.get()));
> }

nit: insert a space between function arguments, e.g.:

  dirSpec.Insert(".", 0);

oh, and use the character versions of the string methods when possible, e.g.:

  dirSpec.Insert('.', 0);


>Index: netwerk/streamconv/converters/ParseFTPList.cpp

>         else if (  (toklen[2] == 10 || toklen[2] == 11) &&      
>                         (tokens[2][toklen[2]-5]) == '-' &&
>                         (tokens[2][toklen[2]-9]) == '-' &&
>+        (((toklen[3]==4 || toklen[3]==5 || toklen[3]==7 || toklen[3]==8) &&
>+                        (tokens[3][toklen[3]-3]) == ':' ) ||
>+         ((toklen[3]==10 || toklen[3]==11 ) &&
>+                        (tokens[3][toklen[3]-3]) == '.' )
>+        ) &&  /* time */

some kind of comment explaining this conditional would be nice :)


>+// I've never seen size come back in bytes, its always in blocks, and 
>+// the following test fails. So, always perform the "size in blocks".
>+// I'm leaving the "size in bytes" code if'd out in case we ever need
>+// to re-instate it.

use /* */ style comment block instead (stick with prevailing style).


>                * ulltoa(((unsigned long long)fsz)<<9, result->fe_size, 10);
>               */
>+              // A block is always 512 bytes on OpenVMS, compute size.
>+              // So its rounded up to the next block, so what, its better
>+              // than not showing the size at all.
>+              // A block is always 512 bytes on OpenVMS, compute size.
>+              // So its rounded up to the next block, so what, its better
>+              // than not showing the size at all.

nit: prevailing comment style is /* */, so please stick with it.  in
fact, why don't you just continue the previous comment block?


>+              PRUint64 fsz = (PRUint64) strtoul(tokens[1], (char **)0, 10);
>+              LL_MUL(fsz, fsz, 512);
>+              PR_snprintf(result->fe_size, sizeof(result->fe_size), "%lld", fsz);

  PRUint64 fsz, factor;
  LL_UI2L(fsz, strtoul(tokens[1], (char **)0, 10));
  LL_UI2L(factor, 512);
  LL_MUL(fsz, fsz, factor);
  ...
Attachment #129437 - Flags: superreview-
Attachment #129030 - Flags: superreview?(darin)
I think I've addressed all your comments, Darin, except for putting the space
between the args on some of the lines of code like this:

dirSpec.Insert(".",0);

The lines I added I did insert a space. But many of the lines in my patch I
didn't add, I only moved existing lines. Those ones I didn't change since I
figured leaving them as is was as close to prevailing style as I could get :-)
Attachment #129437 - Attachment is obsolete: true
Attachment #129797 - Flags: superreview?(darin)
Comment on attachment 129797 [details] [diff] [review]
Incorporate Darin's comments

>Index: netwerk/protocol/ftp/src/nsFtpConnectionThread.cpp

>+            if (respStr.Last() != '/')
>+                respStr.Append("/");

nit:		  respStr.Append('/');


yeah, the coding style was already inconsistent... oh well :-/

sr=darin
Attachment #129797 - Flags: superreview?(darin) → superreview+
Colin, can you take this fix into your build and then land the patch into cvs in
1.6alpha?
Flags: blocking1.5b? → blocking1.5b-
Asa, this bug is for Mozilla support for VMS FTP *servers*, not for VMS-Mozilla.
Please reconsider.
Flags: blocking1.5b- → blocking1.5b?
Whiteboard: verify 138278 after this is fixed.
Comment on attachment 129797 [details] [diff] [review]
Incorporate Darin's comments

I think Darin has hit all the issues.  Couldn't find any holes in the
string-handling that might cause problems.  r=rjesup
Attachment #129797 - Flags: review+
Comment on attachment 129797 [details] [diff] [review]
Incorporate Darin's comments

a=chofmann for 1.5b..  need to get this in quickly if we are going to take for
beta/final..  dougt can you also do a review on this if you get a chance just
to make sure we don't potencially set up a regression late in the game for
1.5b?
Attachment #129797 - Flags: approval1.5b+
Its checked in! Thanks guys - that was unexpected.
Marking fixed.
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Flags: blocking1.5b? → blocking1.5b+
Blocks: 219768
VERIFIED/MacOS:
1.5RC1 works, 1.5a did not.
Keywords: helpwantedverifyme
Whiteboard: checkwin, checklinux
V/fixed: Mozilla 1.7RC2, Linux
Status: RESOLVED → VERIFIED
Keywords: verifyme
Whiteboard: checkwin, checklinux → checkwin
V/fixed: mozilla 1.7.2, win xp
Whiteboard: checkwin
Product: Core → Core Graveyard
Type: enhancement → defect
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: