Closed Bug 39562 Opened 20 years ago Closed 9 years ago

hostinfo.dat "<name>,,x,y,z" needs to be fixed

Categories

(MailNews Core :: Networking: NNTP, defect, minor)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 3.3a3

People

(Reporter: sspitzer, Assigned: ewong)

References

()

Details

Attachments

(1 file, 2 obsolete files)

I'm writing out newsgroups as "<name>,,x,y,z"

I have to write the code to the right thing here.
aceepting.
Status: NEW → ASSIGNED
Component: Subscribe → Account Manager
Hardware: PC → All
Target Milestone: --- → M17
aceepting.
Component: Account Manager → Subscribe
David,

Is this something that has to be fixed for rtm?  If is isn't could you move this 
to the future milestone?
yes, I think this should be fixed for RTM. I'm not sure what should be between
those two commas, but I imagine it was there for a reason. I'll look into it in
beta3.
Assignee: sspitzer → bienvenu
Status: ASSIGNED → NEW
Keywords: nsbeta3
correct milestone to align w/nsbeta3 nomination
Target Milestone: M17 → M18
accepting
Status: NEW → ASSIGNED
Keywords: correctness
reassigning back to Seth, removing nsbeta3 keyword. This is much further from
being done than I thought. I'm not going to have time to do this.
Assignee: bienvenu → sspitzer
Status: ASSIGNED → NEW
Keywords: nsbeta3
clearing milestone, m17 and m18 are meaningless now.  these need to be triages
along with the rest.
Target Milestone: M18 → ---
QA Contact: lchiang → stephend
I don't understand this bugreport.
Severity: normal → minor
No action in more than 3 years, can't this bug be closed?
Product: Browser → Seamonkey
Assignee: sspitzer → mail
Component: MailNews: Subscribe → MailNews: Message Display
QA Contact: stephend → search
No, the passage of time doesn't automatically erase broken things.

It's about the URL field: when nsNntpIncomingServer.cpp writes hostinfo.dat, it adds a useless and static ",,1,0,0" onto each line, apparently trying to be compatible with Netscape 4.x. If someone wanted to reverse-engineer what 4.x was doing there, and then wanted to use whatever it was, they could fix it to write actual data, or, we could save 7 bytes per group by just dropping it, since we no longer really have any desire to keep profile files easily migrated back and forth with 4.x, as long as whatever strips it off when it's read (which I can't seem to find) wouldn't mind seeing our newly comma-free version.
Assignee: mail → nobody
Component: MailNews: Message Display → Networking: News
OS: Windows NT → All
Priority: P3 → --
Product: SeaMonkey → Core
QA Contact: search → networking.news
I could take a gander at what the fields mean:

<newsgroup name>,<description>,<first>,<last>,<num>.

I'm not sure how much of an impact being wrong would have, especially since we have our own hacked output to deal with anyways. I don't foresee the <first>,<last>,<num> being terribly useful in the future (they'd get out of date pretty quickly); the only one I see much use for is the <description> field (see bug 37775).


de.comm.software.mozilla,,0,494fa09b,5f77
(In reply to comment #12)
> I could take a gander at what the fields mean:
> 
> <newsgroup name>,<description>,<first>,<last>,<num>.

I mostly disagree.
Here's a snippet from my today's ;-) Netscape 4.80 (en, Windows) hostinfo.dat file:

de.comm.software,,0,494fa098,15a2
de.comm.software.mozilla,,0,494fa09b,5f77
de.comm.software.mozilla.browser,,1,494fa09b,5f78
de.comm.software.mozilla.mailnews,,1,494fa09b,5f79
de.comm.software.mozilla.misc,,1,494fa09b,5f7a
de.comm.software.mozilla.nightly-builds,,1,494fa09b,5f7b

The second field is empty for all groups, on different servers. But I, too, suspect that it had been designated for either the ng tagline or maybe a customized name. I doubt it was ever implemented, though - if NS4 doesn't set it, who else?
I'm not that bored to decompile NS4. ;-)

My guess for x,y,z:

x   0=tree node, 1=actual newsgroup
y   494fa09b=1229955227=2008-12-22 14:13:47=>timestamp
    Some experimentation shows that it doesn't change with list updates or
    news download or news reading, so I suspect "group seen for the first time"
    (I newly created the newsserver account for this test.)
z   looks like a consecutive, newsserver-dependent ng number
> z   looks like a consecutive, newsserver-dependent ng number

To be more precise:
Whenever Netscape sees a new group name, it builds a new entry for every missing hierarchy node, consecutively numbered. In my case, most of the output of a LIST command is unsorted (maybe roughly sorted by group creation), but you can see how z follows the order of this LIST dump.
Well, I highly doubt that preserving the x,y,z is important, since we've lived without it for years without everything blowing up in our face. If NS4 doesn't make use of that second position, we can insert whatever we want in there without anyone complaining.

I think I'll probably go ahead and strip the whole ,,1,0,0 stuff and make the input null-resistant if/when support for descriptions is added.
(In reply to comment #15)
> I think I'll probably go ahead and strip the whole ,,1,0,0 stuff and make the
> input null-resistant if/when support for descriptions is added.

Sounds reasonable.
Since descriptions can contain commas, it wouldn't have worked anyway (without some escape mechanism)...
Product: Core → MailNews Core
Whiteboard: [good first bug]
Taking this bug for a spin.
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Attachment #501002 - Flags: review?(mnyromyr)
Comment on attachment 501002 [details] [diff] [review]
Removed ,,x,y,z from the newsgroups lines in hostinfo.dat (v1)

>+++ b/mailnews/news/src/nsNntpIncomingServer.cpp
>@@ -811,9 +811,9 @@ writeGroupToHostInfoFile(nsCString &aEle
>         return PR_FALSE;
>     }
>     PRUint32 bytesWritten;
>-    // XXX todo ",,1,0,0" is a temporary hack, fix it
>+

No empty line needed.

>     stream->Write(aElement.get(), aElement.Length(), &bytesWritten);
>-    stream->Write(",,1,0,0"MSG_LINEBREAK, 7 + MSG_LINEBREAK_LEN, &bytesWritten);
>+    stream->Write(MSG_LINEBREAK, MSG_LINEBREAK_LEN, &bytesWritten);
>     return PR_TRUE;

The change also craves for a comment before this:

1265     char *commaPos = (char *) PL_strchr(line,',');
1266     if (commaPos) *commaPos = 0;

Like "Old hostinfo files (v1) had additional data fields, delimited by commas."
And, of course, you need to increment VALID_VERSION.
Attachment #501002 - Flags: review?(mnyromyr) → review-
Attachment #501002 - Attachment is obsolete: true
Attachment #504677 - Flags: review?
Attachment #504677 - Flags: review? → review?(mnyromyr)
Comment on attachment 504677 [details] [diff] [review]
Removed ,,x,y,z from the newsgroups lines in hostinfo.dat (v2)

>   if (mHasSeenBeginGroups) {
>+  	// v1 hostinfo files had additional data fields delimited by commas.
>+  	// with v2 hostinfo files, the additional data fields are removed.
>     char *commaPos = (char *) PL_strchr(line,',');

Don't use tabs for indentation, just spaces.
r=me with that.
Attachment #504677 - Flags: review?(mnyromyr) → review+
Fixed nit from comment #21.
Attachment #504677 - Attachment is obsolete: true
Attachment #512074 - Flags: review+
Attachment #512074 - Flags: superreview?(bienvenu)
Comment on attachment 512074 [details] [diff] [review]
Removed ,,x,y,z from the newsgroups lines in hostinfo.dat (v3)

you don't need sr, but it wouldn't hurt to have jcranmer look at this...
Attachment #512074 - Flags: superreview?(bienvenu) → review?(Pidgeot18)
Comment on attachment 512074 [details] [diff] [review]
Removed ,,x,y,z from the newsgroups lines in hostinfo.dat (v3)

I see no problems with this.
Attachment #512074 - Flags: review?(Pidgeot18) → review+
Pushed as <http://hg.mozilla.org/comm-central/rev/060665d0fca7>.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Keywords: checkin-needed
Whiteboard: [good first bug]
Target Milestone: --- → Thunderbird 3.3a3
You need to log in before you can comment on or make changes to this bug.