-
Notifications
You must be signed in to change notification settings - Fork 512
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
Provide request body in request info. #811
Changes from 1 commit
61b7ded
6a05fcd
defe625
0ffbf09
903f158
7899025
562ba7b
6786b1f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -127,10 +127,10 @@ def _get_request_body(self, request, outgoing_data): | |
if outgoing_data is not None: | ||
size = None | ||
if outgoing_data.isSequential(): | ||
# In a sequential QIODevice, size() will return the value of | ||
# bytesAvailable(), which is only the size of the QIODevice | ||
# buffer, not the size of the whole data. Until a read attempt, | ||
# it is zero. | ||
# In a sequential QIODevice, size() returns the value of | ||
# bytesAvailable(), which is only the size of the data in the | ||
# QIODevice buffer and not the total size of the output. Until | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know if tests trigger this behavior (data with a size larger than a buffer)? It seems new tests only use very small request bodies. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good point. I added a test for it. |
||
# a read attempt, the buffer is empty and size() returns zero. | ||
# | ||
# In requests generated by Qt WebKit, outgoing_data is a | ||
# WebCore::FormDataIODevice object, which is sequential. Its | ||
|
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 is often easier to read functions when special cases are handled first:
this also provides more horizontal space (less nesting).