Closed Bug 419592 Opened 17 years ago Closed 4 years ago

Replace news/pop/smtp calls to nsMsgProtocol::OpenNetworkSocketWithInfo with nsMsgProtocol::OpenNetworkSocket

Categories

(MailNews Core :: Backend, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WORKSFORME
mozilla1.9.1b3

People

(Reporter: standard8, Assigned: sgautherie)

References

Details

(Keywords: helpwanted)

Attachments

(1 file, 1 obsolete file)

In our news, pop and smtp implementations we have various calls to nsMsgProtocol::OpenNetworkSocketWithInfo, these can be replaced by nsMsgProtocol::OpenNetworkSocket.

This replacement will reduce duplicated code (getting host/ports etc), and also means that the calls to NS_ExamineForProxy can be dropped which will help the move to the frozen API.

Depends on bug 419591 as we need to ensure OpenNetworkSocket is implemented  before we do this replacement.
Blocks: 433316
No longer depends on: 419591
Depends on: 419591
Product: Core → MailNews Core
Attached patch (Av1) Replace the callers (obsolete) (deleted) — Splinter Review
[Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.9.1b3pre) Gecko/20081127 SeaMonkey/2.0a2pre] (home, debug default) (W2Ksp4)
(http://hg.mozilla.org/mozilla-central/rev/28a7fa014b03
+http://hg.mozilla.org/comm-central/rev/3c516d1c1248)

Looks rather straightforward.
Assignee: nobody → sgautherie.bz
Status: NEW → ASSIGNED
Attachment #350360 - Flags: superreview?(bienvenu)
Attachment #350360 - Flags: review?(bienvenu)
Target Milestone: --- → mozilla1.9.1b3
Attachment #350360 - Flags: superreview?(bienvenu)
Attachment #350360 - Flags: superreview-
Attachment #350360 - Flags: review?(bienvenu)
Attachment #350360 - Flags: review-
Comment on attachment 350360 [details] [diff] [review]
(Av1) Replace the callers

this patch has bit-rotted in news, but more importantly, it broke pop3 download for me for one of my accounts, so I'm going to have to minus it. With the patch, I get a cert error, and I don't get the option to override it. w/o the patch, I can read mail fine. So this needs some investigation.
Attached patch (Av1a) Replace the callers (deleted) — Splinter Review
Av1, with un-bit-rotted News part after bug 463096.

Do you have steps or a test(case) for the Pop3 issue ?
Attachment #350360 - Attachment is obsolete: true
Attachment #354311 - Flags: review?(bienvenu)
my att&t pop account no longer gets new mail with your patch, when configured to use ssl. So I really can't approve that.
(In reply to comment #5)
> Do you have steps or a test(case) for the Pop3 issue ?

I've not tried it but I may be able to guess. Set up a new pop account with a
hostname that's incorrect or something. Then, set the hostname to the correct
address. Then with the patch you will fail - the reason being the RealHostName
"translation".

The news one will fail in the same way as well.
Comment on attachment 354311 [details] [diff] [review]
(Av1a) Replace the callers

if this is simply un-bitrotting the old patch, I have to minus it...standard8's idea sounds right, though - realhostname is different than hostname for the account that's having the problem.
Attachment #354311 - Flags: review?(bienvenu) → review-
Depends on: 470973
I've just attached a couple of unit tests to bug 470973 (that I wanted for password manager), but should help check against regressions with this bug.

This bug also doesn't need to block bug 433316.
No longer blocks: 433316
(In reply to comment #7)

I confirm these steps (with a Newsgroup account).
prefs.js ends up with
{
user_pref("mail.server.server2.hostname", "initialHostName");
user_pref("mail.server.server2.realhostname", "currentHostName");
}
Though the error dialog displays |.realhostname|, 'Subscribe' actually tried to connect to |.hostname|.
So, it seems I trusted comment 0 and removed host, port and proxy, from the callers, without checking _all_ the details.

1 - Port

NNTP used |m_url|; Pop3 and |OpenNetworkSocket()| use |aURL|.
Does it matter ?

http://mxr.mozilla.org/comm-central/source/mailnews/base/util/nsMsgProtocol.cpp#165

2 - (Real)HostName

I would need to re-add something like
{
    nsCAutoString realHostName;
    server->GetRealHostName(realHostName);
    NS_ENSURE_SUCCESS(rv, rv);
    aURL->SetHost(realHostName);
    NS_ENSURE_SUCCESS(rv, rv);
}
Maybe duplicating |aURL|, if it is not safe to modify its |Host| ?

http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/base/src/nsStandardURL.cpp#1355

3 - Proxy

It looks like I should not remove the |NS_ExamineForProxy()| call,
but instead "move" it to |OpenNetworkSocket()|, which currently handles "smtp" only ?

http://mxr.mozilla.org/comm-central/source/mozilla/netwerk/base/public/nsNetUtil.h#772
Keywords: helpwanted
Blocks: mailnews-libxul
No longer blocks: 377319
Note that NS_ExamineForProxy has been replaced by MsgExamineForProxy.

This has a TM set, but was something even checked in?

Flags: needinfo?(mkmelin+mozilla)

I don't know. But nsMsgProtocol::OpenNetworkSocket doesn't exist anymore. So probably not worth keeping open.

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Flags: needinfo?(mkmelin+mozilla)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: