-
Notifications
You must be signed in to change notification settings - Fork 39
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
Progress callbacks in HTTPLite #114
Comments
An easy way to do this would be to copy the HTTPLite.download method from JoiPlay which would also make cross-compatibility easier.
https://github.com/joiplay/mkxp/blob/master/src/http.h#L15 I'll see if my team actually needs it and try to contribute it if we do. |
We'd really like to have this available. However the related code seems to be very different between JoiPlay and mkxp-z so it's not possible to just copy it as I first thought. mkxp-z doesn't even have a http.h and http.cpp files. I have no experience with C++ so it seems I won't be able to contribute this unfortunately. Still I'd really appreciate if it was available. It's hopefully not too difficult for an experienced C++ programmer? It doesn't really matter if the API is the same as in JoiPlay or not, I can easily add a condition in the script. I just need it to be able to write the response body into a file (HTTPLite.get seems to put the entire response body into a variable which isn't ideal) and be able report progress using a callback or something. |
I'm happy to give it a look, but it may take me some time due to other priorities. If anyone else wants to give this a try before I get to it, I would really like the API to match JoiPlay unless there's some reason not to do so. |
In this case, my C++ experience isn't an issue, but my experience with Ruby definitely is (since this involves interaction between C++ and Ruby code, and I've only been using Ruby for just over a year). I'm pretty good at learning fast, so I don't anticipate being unable to implement this, but I will definitely have to learn some stuff to do it. |
With the findings from #118 I should be able to use net/http instead so this is probably unnecessary. |
Noted, and thanks for finding an alternative solution! I'd still happily accept a PR for adding this if the API matches JoiPlay, but good to know I can lower the priority on this for now. |
Note that it's not yet confirmed that net/http will work, it's just a hypothesis for now. I didn't try it yet. :) I'll let you know how it goes ofc. |
Alright so... net/http does work as long as I avoid https. With https it fails like this:
So what's the issue with openssl? In mkxp-z's code there are plenty ifs and code regarding openssl, for instance this: Lines 41 to 53 in 52c932b
Which seems to indicate that it should be possible to get openssl working. What's required to actually enable it? |
We managed to sort out https issues as well in #118 so I think this can be closed now. |
I'm a little ambivalent on whether to close this since maybe someone wants this for HTTPLite specifically rather than via the Ruby standard library. Anyone have opinions on whether doing this with HTTPLite is a legit use case given that the Ruby stdlib seems to be an alternative? |
@enumag requested progress callbacks in HTTPLite. Looks like this should be easy since cpp-httplib already supports this on the C++ side.
The text was updated successfully, but these errors were encountered: