-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Remove qhttp; replace with curl and qhttpengine #1169
Conversation
68f7a2b
to
150f9f2
Compare
Please put the review on hold while I figure out these dependency issues... |
If I may jump in and offer a bit of help... QHttpEngine wasn't added to Ubuntu until Yakkety (16.10) was released. Unfortunately, Travis CI is still using Trusty (14.04) for their default build environment. I do maintain a PPA with builds for Xenial (16.04) but apparently Travis CI doesn't provide an option for building on Xenial yet (even though it was released over a year and a half ago). Apparently it may be possible to use Xenial in Docker on Travis CI. I'm not entirely sure how that would work but it seems to be the only option. |
After giving this some more thought - one other option is to stick with Trusty, add this PPA, and then download/build/install QHttpEngine directly. I use a similar approach for testing QHttpEngine itself in Travis CI - you might find this useful: https://github.com/nitroshare/qhttpengine/blob/master/.travis.yml |
Hi @nathan-osman. Unfortunately the distribution hoops and significant difference in version (0.1 vs 1.0) are leading me to have to go back to libmicrohttpd. I didn't realize there was such a difference between version ticks. Would it be possible to smooth out what is already in the downstream repos, especially Debian? At this point you have the only actively maintained qt http wrapper/lib on the market. I checked out every other c/c++ option and they all fall apart in various areas, mainly in upkeep and distribution. It would be worth a little investment before qt6 comes out with a built-in http solution (hopefully). |
I'd love to but I don't have package upload rights to Debian so I'm dependent on getting a sponsor to upload new versions of the package. And yes, there were some rather significant changes between versions which makes this more complicated since the new version will probably require a new package name to avoid breaking existing packages. One option is always just embedding QHttpEngine in your project's source code. It is released under the MIT license so it should be usable pretty much anywhere. |
One of the main drivers in this move to your engine is Debian requiring us to move the http libraries outside the code base (ie, in a dynamically linked library) to allow for security updates and comply with their policies. We have a line in with the Debian folks, it might be easy to just append a modifier like |
150f9f2
to
cfb7aa8
Compare
@droidmonkey I tried using the following lines in # ...
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(QHttpEngine REQUIRED CONFIG)
set(qhttpengine QHttpEngine)
find_package(CURL REQUIRED)
set(curl CURL)
else()
find_package(qhttpengine REQUIRED CONFIG)
find_package(curl REQUIRED)
endif()
# ... It was able to find |
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.
Only two minor style issues. Apart from that, this looks amazing. +132 −7,008 == 😍
I hope we can solve the dependency problems soon.
src/gui/EditWidgetIcons.cpp
Outdated
} | ||
|
||
void EditWidgetIcons::fetchFaviconFromGoogle(const QString& domain) | ||
#ifdef WITH_XC_HTTP | ||
size_t writeCurlResponse(char *ptr, size_t size, size_t nmemb, void *data) |
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.
Pointer operator belongs to type.
resetFaviconDownload(); | ||
emit messageEditEntry(tr("Unable to fetch favicon."), MessageWidget::Error); | ||
} | ||
QByteArray* res = static_cast<QByteArray*>(data); |
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.
No need to shorten variable names like that here.
@adolfogc careful, the qhttpengine located in the linux distros is the old version and incompatible with the v1.0 that I coded against. Working with the package maintainer to fix that issue. |
Great! |
cfb7aa8
to
52a5666
Compare
52a5666
to
346ff5a
Compare
346ff5a
to
c7d2f1f
Compare
c7d2f1f
to
4ff4e9b
Compare
What the status of this PR? Is it still relevant with the HTTP module being dropped in the (quite) near future? Maybe the curl part is still important? |
Yes, this is still scheduled for 2.3. qhttp is just too buggy. |
4ff4e9b
to
b21783e
Compare
Hello, great to see there's an update. I have a question and feedback: About qhttpengine:
Is there still a plan to go back to libmicrohttpd? I'm not sure if I should create a qhttpengine package for MacPorts (I'm the maintainer of KeePassXC at MacPorts). About curl: Just like the case in #1169 (comment), on Arch Llinux I need to change [1] https://gitlab.kitware.com/cmake/cmake/blob/master/Modules/FindCURL.cmake |
libmicrohttpd is off the table, I want to stick with the Qt solution. Please do build a qhttpengine package for macports. I'll fix the package finder for CURL |
Hello, could you rebase this? The yubikey fix is merged into develop (d911987) and leads to a conflict. |
closing in favor of a new PR that only implements CURL. |
Description
This PR completely removes qhttp and replaces with the following packages:
The custom icon download sequence was significantly improved with code reduction around 60% and no recursion.
Note: This PR requires the debian repositories to be updated with qhttpengine 1.x before merging
Fixes #913
Motivation and context
The primary driver for this change is to align with Debian requirements. Secondarily, we are moving off of an unsupported, flaky library.
How has this been tested?
Manually; automated test cases should be written for this when KeePass-Browser is merged.
Types of changes
Checklist:
-DWITH_ASAN=ON
. [REQUIRED]