Skip to content
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

Server: Restore body() accessor in QgsRequestHandler #4391

Merged
merged 1 commit into from
Apr 21, 2017

Conversation

dmarteau
Copy link
Contributor

Description

Restore body() accessor and clearBody() method in QgsRequestHandler. This feature was removed
and thus was preventing replacing/editing response body in server plugins.

@rldhont rldhont requested review from elpaso and rldhont April 21, 2017 12:18
@rldhont rldhont added the Server label Apr 21, 2017
@rldhont rldhont added this to the QGIS 3 milestone Apr 21, 2017
@dmarteau dmarteau force-pushed the server_request_body_accessor branch from 5eb5a0e to 35eed2f Compare April 21, 2017 12:26
Copy link
Contributor

@elpaso elpaso left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fixes!
I just added some minor notes, please have a look.

* Get the data written so far
*
* This is implementation dependant: some implementations may not
* give access to the underlyng and return an empty array.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/underlyng/underlying/

BTW don't get why you stress that it might return an empty array. Are you thinking at the a streaming response case?
In that case, the reason for getting an empty array would be dependant on the moment that this function is called: if it's called in responseComplete() you might get an empty array, but if called in sendResponse() you should get the current chunk, as you correctly mention here below.

Or am I missing something?

@@ -17,7 +17,7 @@
* Examples of possible mechanisms are cgi Get, cgi Post, SOAP or the usage
* as a standalone command line executable
*/
class QgsRequestHandler /Abstract/
class QgsRequestHandler / Abstract /
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious: these extra spaces are from the astyle command? Or from sipify ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use qgisstyle and qgisstyle introduces syntax errors in sip files.

/**
* Truncate internal buffer
*/
virtual void truncate() = 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case for truncate()? Is that really necessary?

    Restore clearBody() method in QgsRequestHandler
@dmarteau dmarteau force-pushed the server_request_body_accessor branch from 35eed2f to a55390e Compare April 21, 2017 12:33
@rldhont rldhont merged commit 11bb234 into qgis:master Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants