Closed Bug 1396488 Opened 7 years ago Closed 7 years ago

SSL_Option(Set|Get)(|Default) don't really accept a boolean

Categories

(NSS :: Libraries, enhancement)

enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Future

People

(Reporter: mt, Assigned: mt)

Details

Attachments

(1 obsolete file)

The value of SSL options is actually an integer (PRIntn), but the header file lists PRBool (which is typedef'd to PRIntn).  There are already cases where we pass a value of 2 or 3.

I've found a case where an integer would be useful and I'm proposing that we change the API official.
If you change PRBool to PRIntn, we should retain ABI compatibility.

If old application code, that passes PRBool*, is built against modified headers, will compilers complain?
They shouldn't, because it's just a typedef for PRIntn
http://searchfox.org/mozilla-central/source/nsprpub/pr/include/prtypes.h#475
Comment on attachment 8904131 [details]
Change SSL_Option(Set|Get)(|Default) to use PRIntn

Flagging Kai for review here because he doesn't seem to have an account on the new phab instance yet.
Attachment #8904131 - Flags: review?(kaie)
I think I created an account, but I'm not getting any email notifications.
I'll review, but in addition I've asked Hubert by email to give us feedback, if he can see any potential negative consequences, despite our optimism.
Comment on attachment 8904131 [details]
Change SSL_Option(Set|Get)(|Default) to use PRIntn

I've provided feedback in Phabricator. I've suggested some documentation and debug assertion changes. I'll mark this as reviewed in phabricator after your response.
Attachment #8904131 - Flags: review?(kaie)
for the record: I agree with Eric, it shouldn't cause any issues
Thanks Hubert.  Kai, I have updated the code, and responded.  The only change is adding comments.  I hope that's OK.
Attachment #8904131 - Flags: review+
https://hg.mozilla.org/projects/nss/rev/c3ccbe0e91cf2ed741f649f1b7f10054cfafc2dc

Note that this is on the NSS_TLS13_DRAFT19_BRANCH branch.  Hopefully that will merge at some point.
Assignee: nobody → martin.thomson
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → Future
Attachment #8904131 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: