RESOLVED FIXED 24349
[Qt] HTTP status text is never set
https://bugs.webkit.org/show_bug.cgi?id=24349
Summary [Qt] HTTP status text is never set
Adam Bergkvist
Reported 2009-03-04 06:11:44 PST
Attachments
patch (1.51 KB, patch)
2009-03-04 06:24 PST, Adam Bergkvist
ap: review+
Adam Bergkvist
Comment 1 2009-03-04 06:24:17 PST
Alexey Proskuryakov
Comment 2 2009-03-05 04:54:15 PST
Comment on attachment 28263 [details] patch r=me
Holger Freyther
Comment 3 2009-03-07 05:08:50 PST
Comment on attachment 28263 [details] patch > + response.setHTTPStatusText(m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray().constData()); this is weird... QString -> QByteArray -> constData -> String when we have a QString -> String already...
Alexey Proskuryakov
Comment 4 2009-03-09 01:16:12 PDT
I'm reluctant to make any changes, as I don't have a Qt build, but please feel free to tweak and land.
Adam Bergkvist
Comment 5 2009-03-09 02:31:05 PDT
(In reply to comment #3) > (From update of attachment 28263 [details] [review]) > > > + response.setHTTPStatusText(m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toByteArray().constData()); > > this is weird... > QString -> QByteArray -> constData -> String when we have a QString -> String > already... > m_reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute) is a QVariant::ByteArray. We could do a toString() to construct a QString, but that would cause an extra copy of the character data.
Holger Freyther
Comment 6 2009-03-09 02:41:07 PDT
I only looked at the Qt site of things and: grep -rn HttpReasonPhraseAttribute * qnetworkaccesscachebackend.cpp:81: setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute)); qnetworkaccesshttpbackend.cpp:772: setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, httpReply->reasonPhrase()); qnetworkaccesshttpbackend.cpp:890: setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, attributes.value(QNetworkRequest::HttpReasonPhraseAttribute)); qnetworkaccesshttpbackend.cpp:1039: attributes.insert(QNetworkRequest::HttpReasonPhraseAttribute, httpReply->reasonPhrase()); qnetworkrequest.cpp:116: \value HttpReasonPhraseAttribute qnetworkrequest.h:67: HttpReasonPhraseAttribute, and reasonPhrase() is a QString coming from: qhttp.h: QString reasonPhrase() const; qhttpnetworkconnection_p.h: QString reasonPhrase() const; so what am I missing?
Adam Bergkvist
Comment 7 2009-03-09 03:24:30 PDT
Strange... considering that the documentation states that it is a ByteArray. A ByteArray would make sense since the reason phrase can only contain ascii characters. http://doc.trolltech.com/main-snapshot/qnetworkrequest.html#Attribute-enum
Holger Freyther
Comment 8 2009-03-13 03:04:50 PDT
(In reply to comment #7) > http://doc.trolltech.com/main-snapshot/qnetworkrequest.html#Attribute-enum Okay, we should stick with the documentation here.
Alexey Proskuryakov
Comment 9 2009-03-13 03:06:26 PDT
Committed revision 41664.
Note You need to log in before you can comment on or make changes to this bug.