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
Implement XEP-0363: HTTP File Upload: Request IQs #188
Conversation
Codecov Report
@@ Coverage Diff @@
## master #188 +/- ##
=========================================
Coverage ? 66.26%
=========================================
Files ? 151
Lines ? 15015
Branches ? 0
=========================================
Hits ? 9949
Misses ? 5066
Partials ? 0
Continue to review full report at Codecov.
|
9a5ea1c
to
8751c76
Compare
added tests for |
doc/xep.doc
Outdated
@@ -46,5 +46,6 @@ Ongoing: | |||
- XEP-0009: Jabber-RPC (API is not finalized yet) | |||
- XEP-0060: Publish-Subscribe (Only basic IQ implemented) | |||
- XEP-0077: In-Band Registration (Only basic IQ implemented) | |||
- XEP-0363: HTTP File Upload [v0.9.0] |
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.
What does the version refer to?
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.
It's the XEP's version, so we can easily check if an implementation is outdated.
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.
I also added the version number in the header files, maybe that's a bit too much?
4403e56
to
e2b59a9
Compare
Now with a d-pointer. |
e2b59a9
to
510320f
Compare
src/base/QXmppHttpUploadIq.cpp
Outdated
for (QString &name : putHeaders.keys()) { | ||
if (name == "Authorization" || name == "Cookie" || name == "Expires") { | ||
// newlines must be removed | ||
QString value = putHeaders[name]; |
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.
I'm not convinced "removing" newlines is the best option. Also I expect \r isn't accepted either?
Wouldn't failing loudly be more appropriate?
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.
The XEP says we must remove the newlines:
The requesting entity MUST strip any newline characters from the header name and value [...].
Would \r
work on its own (without \n
before)?
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.
I'm not sure, but maybe Qt is already doing this anyway, so we might don't need to remove newlines on our own.
|
||
/// Returns the file's size in bytes. | ||
|
||
qint64 QXmppHttpUploadRequestIq::size() const |
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.
I'm sorry for pointing out these things one by one.. but why fileName() vs size() ? I would expect either name() and size() or fileName() and fileSize().
QXmppTransferFileInfo use name() and size()
Ah.. actually forget this I guess it comes from the XML attribute names.
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.
Yeah right, I took the XML attr. names.
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.
Is that ok or should I better use consistent names?
Could you rebase this please? Also, will there be a manager to handle these IQs? |
This implements the IQs for requesting and receiving upload slots as defined by XEP-0363: HTTP File Upload in version 0.9.0.
510320f
to
fbe8411
Compare
Done. Yes there will be a manager or even two: One for requesting/receiving the slots from the server and one for actually uploading a file from disk. |
Thank you!
And this really helps. |
This implements the IQs for requesting and receiving upload slots as
defined by XEP-0363: HTTP File Upload [v0.9.0].