Use a faster and safer way of flattening the form data.
authorhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2008 11:36:16 +0000 (11:36 +0000)
committerhausmann@webkit.org <hausmann@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 7 Jan 2008 11:36:16 +0000 (11:36 +0000)
Signed-off-by: Lars
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@29223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/platform/network/qt/QNetworkReplyHandler.cpp

index 29df236..1f920fc 100644 (file)
@@ -2,6 +2,15 @@
 
         Reviewed by Lars.
 
+        Use a faster and safer way of flattening the form data.
+
+        * platform/network/qt/QNetworkReplyHandler.cpp:
+        (WebCore::QNetworkReplyHandler::start):
+
+2008-01-07  Simon Hausmann  <hausmann@webkit.org>
+
+        Reviewed by Lars.
+
         Ported of the network backend of the Qt platform to Qt 4.4's new networking API.
 
         * WebCore.pro:
index ea6f8f7..10b54de 100644 (file)
@@ -179,8 +179,9 @@ void QNetworkReplyHandler::start()
             m_reply = manager->get(m_request);
             break;
         case QNetworkAccessManager::PostOperation: {
-            DeprecatedString pd = d->m_request.httpBody()->flattenToString().deprecatedString();
-            m_reply = manager->post(m_request, QByteArray(pd.ascii(), pd.length()));
+            Vector<char> bytes;
+            d->m_request.httpBody()->flatten(bytes);
+            m_reply = manager->post(m_request, QByteArray(bytes.data(), bytes.size()));
             break;
         }
         case QNetworkAccessManager::HeadOperation:
@@ -188,8 +189,9 @@ void QNetworkReplyHandler::start()
             break;
         case QNetworkAccessManager::PutOperation: {
             // ### data?
-            DeprecatedString pd = d->m_request.httpBody()->flattenToString().deprecatedString();
-            m_reply = manager->put(m_request, QByteArray(pd.ascii(), pd.length()));
+            Vector<char> bytes;
+            d->m_request.httpBody()->flatten(bytes);
+            m_reply = manager->put(m_request, QByteArray(bytes.data(), bytes.size()));
             break;
         }
         case QNetworkAccessManager::UnknownOperation: