Conversation
…setopt, expanded curl_getinfo by adding CURLINFO_CERTINFO logic
…AL, PATH_AS_IS, PIPEWAIT, SASL_IR, CONNECT_TO, PROXYHEADER
…FO_CERTINFO option. Added curl_setopt options: SSL_VERIFYSTATUS, NORPOGRESS, NOSIGNAL, PATH_AS_IS, PIPEWAIT, SASL_IR, CONNECT_TO, PROXYHEADER
…_HAPPY_EYEBALLS_TIMEOUT_MS, CURLOPT_HEADEROPT, CURLOPT_POSTREDIR. Defined flags for the logic of headeropt and postredir options
…PY_EYEBALLS_TIMEOUT_MS, CURLOPT_HEADEROPT, CURLOPT_POSTREDIR. Created new option_setter functions for the headeropt and postredir options.
… Updated auth_option_setter logic
… CURLOPT_DEFAULT_PROTOCOL, CURLOPT_DNS_INTERFACE. Added curl_version() function.
…OXY_SSL_CIPHER_LIST, CURLOPT_PROXY_TLS13_CIPHERS, CURLOPT_PROXY_SSLKEY, etc. Removed not supported CURLOPT_DNS_INTERFACE option.
…ion CURLOPT_INFILE support.
…pes, replaced copying of streams with pointers. Completed support for callable options logic
…fferent behaviour compared to php
d7e3b49 to
8fb8c0e
Compare
2604384 to
6748cf9
Compare
builtin-functions/_funcions.txt:
Added an alias CURLOPT_WRITEDATA for the option CURLOPT_FILE.
runtime/curl.h:
Fixed callable type names (<callable_type> -> on_<callable_type>), moved it to namespace.
runtime/curl.cpp:
1. Brought to a general appearance all fields of callable objects of the Easy_Context class: struct {...} <callable_name>_handle.
2. Added an additional null value check to the stream_option_setter function.
3. Deleted the incorrect installation of the method of operation of the curl_read function when installing the CURLOPT_INFILE option.
4. Replaced the curl error code CURLE_WRITE_ERROR with -1 for errors in the stream_option_setter function.
5. Fixed a bug in the curl_read function: copying to a buffer variable is done via calls to $fgets() and memcpy().
Refactored class Process: 1. Deleted unnecessary function run_cmd(). 2. Fixed the definition of the process id using the lsof call relative to the listening port. 3. Added exception throwing and corrected syntax. Added a test for the CURLOPT_WRITEHEADER option: 1. It works by analogy with the test for CURLOPT_FILE. 2. The response headers are written to the file, but kphp returns more information => only the beginning of the file is checked. All tests now take 60 ms to start the server.
… callable options.
…RESSFUNCTION. Refactored tests for stream-options. 14_curl_setopt_streams.php: 1. Moved common variables to the global scope. 2. Increased delays for creating and closing the server: from 60 to 200 ms. 17_curl_setopt_callables.php: 1. Option tests were created by analogy with stream tests. 2. Port values for php and kphp differ from stream tests to avoid intersections. 3. Testing the PROGRESSFUNCTION option uses the CURLOPT_FILE stream option and raises the server, which sends the locally created document to the client when the request is received.
…s in stream-tests. Rewrited the logic of curl_read function in runtime/curl.cpp. curl_read() in runtime/curl.cpp: Previously, the result of calling a custom function was missed, now the returned string is written to memory via memcpy(). testing CURLOPT_READFUNCTION: 1. The test is written by analogy with the test of the CURLOPT_INFILE option, which sends data to the server. 2. At the moment, the user-defined function is required to return exactly the string.
In the runtime in curl.cpp the value of the f$fopen() function is passed as a descriptor, which returns Stream (an alias of a mixed type, which is just a string variable). When calling curl_setopt() with options for stream descriptors, you need to check which mode they are open with. In the kphp runtime, this can only be checked if you have access to static variables from files.cpp . To solve the problem of access to files.cpp, the get_file_mode() function was added, which gets a Stream variable, receives information on FILE* and returns the descriptor mode code. To test get_file_mode(), the f$stream_test() function was also added to curl.cpp which can be called from php code. The stream_option_setter() function was fixed using get_file_mode().
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.