Closed Bug 1501589 Opened Last year Closed Last year

Port bug 1501404 (part 6): Replace use of NS_STARTTLSSOCKETPROVIDER_CONTRACTID - nsLDAPSecurityGlue.cpp:157:39: error: use of undeclared identifier 'NS_STARTTLSSOCKETPROVIDER_CONTRACTID'

Categories

(MailNews Core :: LDAP Integration, task, blocker)

task
Not set
blocker

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 65.0

People

(Reporter: mkmelin, Assigned: mkmelin)

References

Details

Attachments

(1 file, 4 obsolete files)

From bug 1501404 part 6 - https://hg.mozilla.org/mozilla-central/rev/1766ed669623

nsLDAPSecurityGlue.cpp:157:39: error: use of undeclared identifier 'NS_STARTTLSSOCKETPROVIDER_CONTRACTID'
Think this should do it, but other build errors prevents verifying it
Attachment #9019603 - Flags: review?(jorgk)
Comment on attachment 9019603 [details] [diff] [review]
bug1501589_NS_STARTTLSSOCKETPROVIDER_CONTRACTID.patch

Review of attachment 9019603 [details] [diff] [review]:
-----------------------------------------------------------------

not ready
Attachment #9019603 - Flags: review?(jorgk)
Indeed, it complains about NS_SOCKETPROVIDERSERVICE_CONTRACTID which was also removed here:
https://hg.mozilla.org/mozilla-central/rev/79795a6721cc#l2.12

You want to use this code:
https://hg.mozilla.org/mozilla-central/rev/1766ed669623#l4.43

+  nsCOMPtr<nsISocketProvider> inst;
+  if (!nsCRT::strcmp(type, "ssl") &&
+      XRE_IsParentProcess() &&
+      EnsureNSSInitializedChromeOrContent()) {
+    inst = new nsSSLSocketProvider();
+  } else if (!nsCRT::strcmp(type, "starttls") &&
+             XRE_IsParentProcess() &&
+             EnsureNSSInitializedChromeOrContent()) {
+    inst = new nsTLSSocketProvider();

So just:
nsCOMPtr<nsISocketProvider> inst = new nsTLSSocketProvider();
Summary: nsLDAPSecurityGlue.cpp:157:39: error: use of undeclared identifier 'NS_STARTTLSSOCKETPROVIDER_CONTRACTID' → Port bug 1501404 (part 6): Replace use of NS_STARTTLSSOCKETPROVIDER_CONTRACTID - nsLDAPSecurityGlue.cpp:157:39: error: use of undeclared identifier 'NS_STARTTLSSOCKETPROVIDER_CONTRACTID'
Done.
Attachment #9019603 - Attachment is obsolete: true
Attachment #9019614 - Flags: review+
Alternatively this. Not sure which is better
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/fc3bc776f223
Port bug 1501404 (part 6): Replace use of NS_STARTTLSSOCKETPROVIDER_CONTRACTID. r=jorgk
Status: NEW → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Hm, actually to use startls it does some more checks - https://hg.mozilla.org/mozilla-central/rev/1766ed669623#l4.48 so perhaps the second version should be used?
Flags: needinfo?(jorgk)
Flags: needinfo?(jorgk)
Target Milestone: --- → Thunderbird 65.0
Umm, you attached the original patch again :-(
You're referring to:
+  } else if (!nsCRT::strcmp(type, "starttls") &&
+             XRE_IsParentProcess() &&
+             EnsureNSSInitializedChromeOrContent()) {
+    inst = new nsTLSSocketProvider();

Well, TB doesn't do e10s, so we don't need the XRE_IsParentProcess(). I don't know what the EnsureNSSInitializedChromeOrContent() is about.
Had forgot to qrefresh. I think this could be preferable. You never know if we start doing e10s one day
Attachment #9019616 - Attachment is obsolete: true
Attachment #9019617 - Flags: review?(jorgk)
Comment on attachment 9019617 [details] [diff] [review]
bug1501589_NS_STARTTLSSOCKETPROVIDER_CONTRACTID.patch

Yes, this compiles too and looks like the better solution. Sorry about the "trigger happy" landing.

Any reason you moved the block up?
Attachment #9019617 - Flags: review?(jorgk) → review+
Reshuffled this a bit. Also made it:
    sps = nsSocketProviderService::GetOrCreate();
    if (!sps || NS_FAILED(sps->GetSocketProvider("starttls", getter_AddRefs(tlsSocketProvider)))) {

The previous solution would have crashed if sps==null.
Attachment #9019614 - Attachment is obsolete: true
Attachment #9019617 - Attachment is obsolete: true
Attachment #9019624 - Flags: review+
Pushed by mozilla@jorgk.com:
https://hg.mozilla.org/comm-central/rev/97346356d25c
Backed out changeset fc3bc776f223 to make way for a better solution. a=backout
https://hg.mozilla.org/comm-central/rev/3eb79f25d25b
Port bug 1501404 (part 6): Replace use of NS_STARTTLSSOCKETPROVIDER_CONTRACTID. r=jorgk
Depends on: 1517418
Type: enhancement → task
You need to log in before you can comment on or make changes to this bug.