-
Notifications
You must be signed in to change notification settings - Fork 731
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
Add missing CURLOPT constants #3636
Conversation
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.
Cursory glance, main question is if the extension handles boolean options with a bool or not.
Also I don't remember if @cmb69 knows a lot about cURL or not.
If set to <literal>0</literal>, transfer decoding is disabled. | ||
If set to <literal>1</literal>, transfer decoding is enabled (default). |
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.
Does this check for a boolean value in the extension or just doesn't care?
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.
The extension just doesn't care and converts all int and bool options' values to long internally.
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.
CURLOPT_HTTP_TRANSFER_DECODING;:
Pass a long to tell libcurl how to act on transfer decoding. If set to zero, transfer decoding is disabled, if set to 1 it is enabled (default).
I wonder how that is actually implemented in cURL.
If I understand the source correctly, the extension converts all values to long before passing them to the appropriate C function. I tested it locally and bool CURLOPT options accepted bool, int and float values too. |
bc3f0e2
to
001cfa5
Compare
@Girgias I've made some updates to the constant list based on your review comments. Could you check my last commit and let me know whether the general direction of the changes will work or not? If it does, I'll update the entire file. If it doesn't, I didn't waste too much time on it yet. :-) |
I quite like what you did in the last commit :) |
A note in case someone would like to tackle this in The constants (so far): |
It would be more important, I think, to declare the missing |
@cmb69 Sorry that I wasn't specific enough but I meant that these constants are not being type checked on |
@haszi, I've actually debugged |
You're right. How did I even miss that part? Sorry for the noise and thanks for checking on this. :-) |
001cfa5
to
06010a6
Compare
@Girgias I've added some applicable tags, information on what type of value each option accepts and (where known) what the default value is. |
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.
Not sure if the acronym tag comments are that useful as it would be adding a lot of them
</term> | ||
<listitem> | ||
<para> | ||
Setting this option to <literal>1</literal> will cause FTP uploads |
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 think having an <acronym>
tag around FTP would be good here.
based on the protocol it is used with. | ||
FTP and SFTP based URLs will list only the names of files in a directory. | ||
POP3 will list the email message or messages on the POP3 server. | ||
For FILE, this option has no effect |
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'm not sure what
For FILE [...]
refers to
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.
Basically file://
.
FTP and SFTP based URLs will list only the names of files in a directory. | ||
POP3 will list the email message or messages on the POP3 server. |
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.
FTP and POP3 have acronyms defined but not SFTP
</term> | ||
<listitem> | ||
<para> | ||
Pass a <type>string</type> that will be sent as account information over FTP |
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.
Acronym tag for FTP
This option makes cURL use CCC (Clear Command Channel) | ||
which shuts down the SSL/TLS layer after authenticating |
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.
Possibly add CCC
to the acronyms file and refer to it here?
<para> | ||
Set to <literal>1</literal> to send a <literal>PRET</literal> command | ||
before <literal>PASV</literal> (and <literal>EPSV</literal>). | ||
Has no effect when using the active FTP transfers mode. |
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.
Acronym tag for FTP
</term> | ||
<listitem> | ||
<para> | ||
If set to a <type>string</type> naming a file holding a CA certificate in PEM format, |
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.
Acronym tag around PEM
effectively disabling the proxy. | ||
Setting this option to an empty <type>string</type> enables the proxy for all hostnames. | ||
Since cURL 7.86.0, IP addresses set with this option | ||
can be provided using CIDR notation. |
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.
CIDR maybe should have an acronym defined
At least adding some would be great! And others might be added later; in my opinion, our current list of acronyms is really meager. |
I took a look at Another (selfish) reason is that I have a PR ready with the same type of tags/value type/default value changes made to all |
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.
On a cursory look, this looks good to me (a single nit below). And I'm fine with postponing the acronyms.
Maybe wait on @Girgias's review before merging.
<member><literal>confidential</literal></member> | ||
<member><literal>private</literal></member> | ||
</simplelist> | ||
. |
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 guess that stray period looks strange when rendered; I'd probably remove it.
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.
The period is needed at the end of the sentence because <simplelist>
rendering only adds the <member>
separating commas.
That <simplelist>
actually renders like this:
This should be set to one of the following strings: clear, safe, confidential, private .
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.
D'oh! I've missed the type="inline"
. Sorry for the noise!
One more thing in regards to acronyms: we should probably add an |
That is a good point, could added 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.
LGTM :)
Add the 52 missing
CURLOPT_*
constants and their descriptions to the cURL predefined constant list.Reference used: https://curl.se/libcurl/c/symbols-in-versions.html