Skip to content

Releases: Qriist/LibQurl

LibQurl v0.90.0

27 Dec 21:12
Compare
Choose a tag to compare

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 that mime_part as a file with the given file name.
  • Added AttachMimeAsPart(). This allows you to embed an entire other mime_handle as a single mime_part. Because there's no way to undo this action, LibQurl will stop tracking the embedded mime_handle and any subsequent calls to that mime_handle will throw an error. Also, using this function after using the embedded mime_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

25 Dec 23:42
Compare
Choose a tag to compare
LibQurl v0.89.0 Pre-release
Pre-release

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) an easy_handle, and returns a mime_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 call MimeInit() to generate a default mime_handle.
    • Per curl's design, mime_handles are attached to that specific easy_handle for its lifetime. As such, a given mime_handle will only ever modify the easy_handle it was created with.
  • Added AttachMimePart() to add content to a mime_handle . This will create the mime_part, set its name, pass the partContent data to libcurl, auto-set the mimetype using magic numbers, and return the mime_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.
  • Added MimeCleanup(). This will safely close out the given mime_handle and all associated mime_parts.
  • 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

22 Dec 13:36
Compare
Choose a tag to compare
LibQurl v0.88.0 Pre-release
Pre-release

"Here, have a cookie."

What's new in this version:

  • curl's entire share interface is now wrapped, allowing different easy_handles 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

18 Dec 17:36
Compare
Choose a tag to compare
LibQurl v0.87.0 Pre-release
Pre-release

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 a CURLcode 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 use GetLastHeader()/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

14 Dec 11:26
Compare
Choose a tag to compare
LibQurl v0.86.0 Pre-release
Pre-release

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 its easy 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 fewer multi options.)
  • Added MultiGetHandles(), which returns a simple array of all easy_handles attached to the given multi_handle.
  • Added GetEasyErrorString() as a clarifying alias for GetErrorString().
  • Added GetMultiErrorString(). Pop in a multi error code, get a simple description of the problem.
  • Added MultiCleanup() to gracefully shut down the given multi_handle plus all associated easy_handles. Manually remove any easy_handles you intend to keep.
  • As part of the above, cleaning up an easy_handle will now auto-disassociate itself from its multi_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

11 Dec 16:28
Compare
Choose a tag to compare
LibQurl v0.85.0 Pre-release
Pre-release

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 an easy_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 the curl.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 to PrintObj().
  • Added the Buffer case to SetPost().
  • 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

09 Dec 07:52
Compare
Choose a tag to compare
LibQurl v0.84.0 Pre-release
Pre-release

Major milestone achieved: libcurl's entire easy interface is now wrapped!

What's new in this version:

  • Added Pause and UnPause for manually un/pausing downloads.
  • Added the advanced options RawSend and RawReceive 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 update SetPost to accept Buffers in the future.)
  • Added DupeInit* to completely duplicate an easy_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

07 Dec 12:57
Compare
Choose a tag to compare
LibQurl v0.83.0 Pre-release
Pre-release

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

07 Dec 06:31
Compare
Choose a tag to compare
LibQurl v0.82.0 Pre-release
Pre-release

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

04 Dec 01:23
Compare
Choose a tag to compare
LibQurl v0.81.3 Pre-release
Pre-release

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.)