-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wordsmithing and naming consistency #1798
Conversation
@@ -806,7 +806,7 @@ | |||
possible to create your own ".conf" and ".tmpl" files and store | |||
them locally, outside the OpenSSL source tree. This environment | |||
variable can be set to the directory where these files are held | |||
and will have Configure to consider them in addition to the | |||
and will have Configure to consider them in preference to the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree, but perhaps it's my english. I understand "in preference" that Configure
would look at the indicated local config dir instead of the standard ones. That is not the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't feel particularly strongly, but "in addition to", to me, indicates that it is appended at the end, so that if something is in the systemwide configuration it takes effect first. Maybe we want something about "override".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, how about "will have Configure consider them before looking in the standard ones."?
@@ -111,39 +111,39 @@ or | |||
|
|||
is called before the free operation. | |||
|
|||
=item B<BIO_read_ex(b, out, outl, read)> | |||
=item B<BIO_read_ex(b, data, dlen, read)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would replace all occurences of read
as parameter with readbytes
, just to avoid shadowing read(2)
and confusing people...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like I missed that part of the change, as the implementation uses readbytes.
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *read); | ||
int BIO_gets(BIO *bp, char *buf, int size); | ||
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes); | ||
int BIO_gets(BIO *bp, char *out, int outl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, please avoid using out
and in
in the BIO input and output routines. It's confusing, as to some people (such as myself), out
signifies something that goes out (i.e. not something you read) and in
signifies something that comes in (i.e. not something you write).
So please revert the BIO_gets()
change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My primary goal was consistency, as the implementation uses out/outl. I'm happy to make it consistent the other way, though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do it the other way around, yes.
int BIO_write(BIO *b, const void *data, int dlen); | ||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written); | ||
int BIO_puts(BIO *bp, const char *buf); | ||
int BIO_puts(BIO *bp, const char *in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the BIO_puts()
change. See my explanation at the BIO_gets()
change.
Make it clear that the OPENSSL_LOCAL_CONFIG_DIR settings take precedence over the in-tree configs.
(Force-)pushed updated versions of both commits. |
int BIO_write(BIO *b, const void *buf, int len); | ||
int BIO_puts(BIO *b, const char *buf); | ||
int BIO_read(BIO *b, void *data, int dlen); | ||
int BIO_gets(BIO *b, char *out, int outl); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, didn't notice this one earlier.
int BIO_read(BIO *b, void *data, int dlen); | ||
int BIO_gets(BIO *b, char *out, int outl); | ||
int BIO_write(BIO *b, const void *data, int dlen); | ||
int BIO_puts(BIO *b, const char *in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... nor this one
|
||
is called before the operation and | ||
|
||
callback_ex(b, BIO_CB_GETS | BIO_CB_RETURN, out, outl, 0, 0L, retvalue, read) | ||
callback_ex(b, BIO_CB_GETS | BIO_CB_RETURN, data, dlen, 0, 0L, retvalue, NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NULL
? Are you sure about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope. Too many calls to keep track of, I guess.
(Updates in progress for all mentioned issues.)
|
||
after. | ||
|
||
=item B<BIO_puts(b, in)> | ||
=item B<BIO_puts(b, data)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: buf
|
||
after. | ||
|
||
=item B<BIO_gets(b, out, outl)> | ||
=item B<BIO_gets(b, data, dlen)> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit-pick: buf
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *read); | ||
int BIO_gets(BIO *bp, char *buf, int size); | ||
int BIO_read_ex(BIO *b, void *data, size_t dlen, size_t *readbytes); | ||
int BIO_gets(BIO *bp, char *data, int dlen); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, please reverse
int BIO_write(BIO *b, const void *data, int dlen); | ||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written); | ||
int BIO_puts(BIO *bp, const char *buf); | ||
int BIO_puts(BIO *bp, const char *data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
... and here
Re |
buf for strings seems reasonable (I'll go with 'size' for the length argument for now) ... and looking at the man page, I still missed several conversions in the previous iteration. So many places to change... |
After the recent reworking, not everything matched up, and some comments didn't catch up to the outl-->dlen and inl-->dlen renames that happened during the development of the recent patches. Try to make parameter names consistent across header, implementation, and manual pages. Also remove some trailing whitespace that was inadvertently introduced.
Updated again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, now I'm happy!
What's your target? master only or master + 1.1.0 or what? Set the PR lables accordingly. |
It looks like the BIO size_t-ification didn't hit 1.1.0, so this should be master-only. (It doesn't look like I have permissions to add/edit labels.) |
Right. Label added |
Merged! |
Make it clear that the OPENSSL_LOCAL_CONFIG_DIR settings take precedence over the in-tree configs. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #1798)
After the recent reworking, not everything matched up, and some comments didn't catch up to the outl-->dlen and inl-->dlen renames that happened during the development of the recent patches. Try to make parameter names consistent across header, implementation, and manual pages. Also remove some trailing whitespace that was inadvertently introduced. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from #1798)
An old wordsmithing patch I had lying around on this branch name, plus some cleanup for the recent BIO rework. Try to make BIO_{read,write}{,ex} and BIO{puts,gets} parameter names match across implementation, declaration, and documentation.