[Development] QNetworkRequest autoDecompress public API review
jgastal at profusion.mobi
Tue Jun 18 15:57:57 CEST 2013
In working to solve  I created the change  which was approved for
merging with a note of something for later fixing. However on trying to
merge it CI showed what turned out to be an issue with the compression test
that was related to Thiago's comment about the usage of #ifndef
QT_NO_COMPRESS on QNetworkRequest.
Solving this in a satisfactory manner will require adding two new methods
to QNetworkRequest, I'm thus asking for an API review. The methods would be:
bool autoDecompress() const;
void setAutoDecompress(bool autoDecompress);
The default value for this would be true as that is what
QHttpNetworkConnection does now, that way behavior will not change. The
"Accept-Encoding" header would NOT be filled in by
QNetworkRequest::addDefaultHeaders() but rather by the HTTP implementation
in use(normally QHttpNetworkConnection) taking in consideration the
- If the users sets an "Accept-Encoding" header auto decompress is set to
- If the user has request auto decompress not be done, "Accept-Encoding"
is not set;
- If the user has requested auto decompress be done, the HTTP
implementation can set the "Accept-Encoding" to whatever values it can
If the HTTP implementation doesn't support any compression(for example our
internal implementation when compiled with QT_NO_COMPRESSS) and the user
requests auto decompress, the HTTP implementation will just silently set
"Accept-Encoding" as "identity" and the user will have lost some
performance but his program will not break.
Does this look ok?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Development