Releases: Qriist/LibQurl
LibQurl v0.90.0
Added most of the rest of the MIME functions. These mostly focus on server-specified formatting requirements.
What's new in this release:
- Added
MimeTreatPartAsFile()
. This tells the server that it should consider thatmime_part
as a file with the given file name. - Added
AttachMimeAsPart(
). This allows you to embed an entire othermime_handle
as a singlemime_part
. Because there's no way to undo this action, LibQurl will stop tracking the embeddedmime_handle
and any subsequent calls to thatmime_handle
will throw an error. Also, using this function after using the embeddedmime_handle
in a transfer will fail; you have to rebuild the entire structure from scratch in order to embed. - Added
MimePartEncoder()
/SetMimePartHeaders()
. These are difficult to get feedback on without a server specifically designed to echo these low-level aspects. While libcurl reports no error, I currently have no proper test case to verify against. - Allowed
SetHeaders()
/SetMimePartHeaders()
and custom header inputs to also accept Objects (in addition to Arrays and Maps).
LibQurl v0.89.0
This update wraps the most important parts of curl's MIME api. Which is to say, those functions that are immediately required to push data. Read the patch notes carefully to understand how it works.
What's new in this release:
- Added
MimeInit()
, which accepts (or defaults to) aneasy_handle
, and returns amime_handle
.- While
EasyInit()
creates some initial mime-related variables when called,MimeInit()
is never called automatically due to how its mere inclusion modifies outgoing data. Thus, unlike with other handles, it is on the user to explicitly callMimeInit()
to generate a defaultmime_handle
. - Per curl's design,
mime_handle
s are attached to that specificeasy_handle
for its lifetime. As such, a givenmime_handle
will only ever modify theeasy_handle
it was created with.
- While
- Added
AttachMimePart()
to add content to amime_handle
. This will create themime_part
, set its name, pass thepartContent
data to libcurl, auto-set the mimetype using magic numbers, and return themime_part
for further processing. The underlying methods are publicly available but their explicit use is discouraged to ensure consistency.- As with similar methods, you can pass almost anything for
partContent
: String, Integer, Object, Map, Array, Buffer, and FileObjects are all uploaded appropriately.
- As with similar methods, you can pass almost anything for
- Added
MimeCleanup()
. This will safely close out the givenmime_handle
and all associatedmime_part
s. - Fixed finding the libcurl dll from an Aris installation.
NOTE: Incidentally, the magic numbers which determine mimetype come from a Windows build of Unix's file
command. While this works flawlessly, it is somewhat inefficient because of the need to temporarily dump variables to disk (though FileObjects are unaffected). My intention is to come back at a later date and incorporate file
's underlying library, libmagic
. It's just low priority due to having a technically working solution.
LibQurl v0.88.0
"Here, have a cookie."
What's new in this version:
- curl's entire
share
interface is now wrapped, allowing differenteasy_handle
s to reuse specified data between them. Most notably, this includes cookies. - As with other handle types, LibQurl will generate a default
share_handle
on launch. GetDate()
now returns an AHK-compatible date string by default. You can still return the unix date by flagging the second parameter.- The SSL cert bundle file will now auto-update from the curl homepage's dedicated url, starting from 90 days since the last local update. If the remote file hasn't been updated in that timeframe (happens occasionally) then LibQurl will query the latest version once per day until an update occurs.
LibQurl v0.87.0
I had intended to get the dependency auditing/updating scripted, but instead I had to file a bug report because vcpkg's "output in json" switch is broken. :D
This release sees several disparate but welcome enhancements.
- Added an internal error handler function that, when a curl function reports an error, pushes all relevant information into an array that lives at
curl.caughtErrors
. Currently, all core functions that would receive aCURLcode
from curl are handled. Other error families are not yet implemented. - Managed to build vcpkg's libcurl port with LibreSSL (instead of OpenSSL), which matches curl's shipped Windows binaries. This isn't currently officially supported by vcpkg but, despite some initial difficulties, the build seems stable. The default SSL is still WolfSSL.
- To match how headers are handled, download payloads (ie, the body) now automatically write to an in-memory buffer if no output is provided before initiating the transfer. Useful for quickly producing one-off tests or other debugging where retaining the contents of the transfer isn't especially important.
- Automatically generated header/body buffers are now allocated just before the transfer that would need them, instead of at
easy_handle
creation. The header buffer reserves 64kb and the body buffer reserves 50mb. As always, you can useGetLastHeader()
/GetLastBody()
to retrieve the contents regardless of where you downloaded it to. - Added
GetDate()
to convert all 20+ curl-supported date string formats to the equivalent unix timestamp.
LibQurl v0.86.0
There are now over 2000 lines of code binding libcurl, with about 30 DLL functions left to go. Whoa!
This release sees the wrapping of several more multi
functions.
- Added
SetMultiOpt()
. Its function is identical to itseasy
counterpart, including tracking options on a per-handle basis. Be advised, however, that libcurl does not provide an auto-enumeration feature for non-easy
options so what is available is currently hardcoded. (This shouldn't be an issue as there are literally hundreds fewermulti
options.) - Added
MultiGetHandles()
, which returns a simple array of alleasy_handle
s attached to the givenmulti_handle
. - Added
GetEasyErrorString()
as a clarifying alias forGetErrorString()
. - Added
GetMultiErrorString()
. Pop in amulti
error code, get a simple description of the problem. - Added
MultiCleanup()
to gracefully shut down the givenmulti_handle
plus all associatedeasy_handle
s. Manually remove anyeasy_handle
s you intend to keep. - As part of the above, cleaning up an
easy_handle
will now auto-disassociate itself from itsmulti_handle
, if required. - Fixed a bad assignment in
AddEasyToMulti()
. - Removed a harmles re-declaration of all constants on startup.
I really want to get auto(ish)-updating and version reporting of libcurl's various subcomponents up and running, so the next LibQurl bump will probably be only that.
LibQurl v0.85.0
Several new notable additions and changes as my understanding of the needs of the project matures.
Register()
is no longer meant for public calling and no longer returns aneasy_handle
. Use the first optional parameter of__New()
to pass the DLL location, if it's non-default.- The second optional parameter of
__New()
now allows you to preselect the loaded SSL provider. Any valid string the user passes will take prority, and then LibQurl will attempt to select from a list of known providers. - If for some reason you don't know what SSL providers your libcurl DLL was built against, you can see a
Map
of your binary's presently known providers with thecurl.availableSSLproviders
class property. - The currently selected SSL provider (whether user-chosen or otherwise curl-defaulted) is now always listed at
curl.selectedSSLprovider
. The version is also displayed, if that is known to libcurl. - Added an automatic graceful cleanup of libcurl.
- The various test case files have been updated to match the new DLL loading behavior.
- Added the
File
case toPrintObj()
. - Added the
Buffer
case toSetPost()
. - Massive upgrade to the included libcurl library.
That last one really is a doozy! I have switched to vcpkg for building and it has made applying features beyond what's included in the curl homepage's provided DLL substantially easier. I will provide better versioned documentation for the packages once I get automated builds set up.
There are a couple caveats to this new build methodology, however. First, http3 support doesn't yet exist in vcpkg's curl port, despite having all the prerequisite libraries within its ecosystem. Second, it's not currently possible to build against forks of OpenSSL, despite curl making the switch to LibreSSL a while back.
I have opened feature requests on both in the last day or so.
microsoft/vcpkg#42622
microsoft/vcpkg#42623
They each have been "assigned" to someone, so hopefully it won't be too long until the vcpkg's builds are able to reach parity with the curl homepage.
Thanks to the scriptibility of vcpkg, I may also be able to better support customized environments, though no promises on that front..
LibQurl v0.84.0
Major milestone achieved: libcurl's entire easy
interface is now wrapped!
What's new in this version:
- Added
Pause
andUnPause
for manually un/pausing downloads. - Added the advanced options
RawSend
andRawReceive
to send protocol-level information through curl. As with POSTing, you can pass a String, Integer, Object, Array, Map, or even a FileObject. You can also just send a Buffer. (I'll probably updateSetPost
to accept Buffers in the future.) - Added
DupeInit
* to completely duplicate aneasy_handle
with the same options, except it'll ignore any previously set write output options in order to avoid accidentally overwriting a download.
*NOTE: on a technical level, DupeInit
does not use curl_easy_duphandle
, but instead calls Init
and then manually copies (almost) all options over with SetOpt
. This ensures that the required internal structures remain as expected.
Finally, I updated the readme to clarify which underlying curl functions have been deprecated and what you should use instead.
LibQurl v0.83.0
No new features, but a massive ~20% speed increase for all DLL calls by initializing each to a static variable containing the memory address.
Went from making 10 million individual DLL calls in 53 seconds to the same amount in 42 seconds. Those numbers also include all the normal data splicing and formatting pursuant to the larger function that wanted the DLL info.
Rather pleased with this result. 😎
LibQurl v0.82.0
New in this verion:
- Added InspectHeader() to easily get the value of a specific header.
- Added GetAllHeaders() to get a mass object of all headers received during the last transfer, including from any redirects.
- Added PrintObj() to fully convert an Object/Array/Map to human-readable text. Will also safely return any accidentally passed strings/integers back to the caller. Printout format was modeled on tidbit's st_printArr function from v1.
LibQurl v0.81.3
If the provided dll cannot be found, the library will now attempt to dynamically fall back on the dll distributed with LibQurl's Aris installation.
(register()'s dll parameter will be optional in the next version, just forgot to include it right now.)