Bug 728912: Use RilRawData.MAX_DATA_SIZE instead of hardcoded constants r=philikon
authorKyle Machulis <kyle@nonpolynomial.com>
Tue, 28 Feb 2012 09:58:04 -0800
changeset 87931 f63d2f5846a5eca8023511c4f87b63c2f5951c45
parent 87930 785345035a3bbfb375ed9a48127086a321fde5f1
child 87932 f6e8ec1367533e289657d4e2312bf793f2ff2863
push id22164
push usermbrubeck@mozilla.com
push dateWed, 29 Feb 2012 18:48:10 +0000
treeherdermozilla-central@3812d0ce274e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersphilikon
bugs728912
milestone13.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 728912: Use RilRawData.MAX_DATA_SIZE instead of hardcoded constants r=philikon
ipc/ril/Ril.cpp
--- a/ipc/ril/Ril.cpp
+++ b/ipc/ril/Ril.cpp
@@ -228,31 +228,31 @@ RilClient::OnFileCanReadWithoutBlocking(
     //   - mIncoming isn't completely read, but there's no more
     //     data available on the socket
     //     If so, break;
 
     MOZ_ASSERT(fd == mSocket.mFd);
     while (true) {
         if (!mIncoming) {
             mIncoming = new RilRawData();
-            int ret = read(fd, mIncoming->mData, 1024);
+            int ret = read(fd, mIncoming->mData, RilRawData.MAX_DATA_SIZE);
             if (ret <= 0) {
                 LOG("Cannot read from network, error %d\n", ret);
                 // At this point, assume that we can't actually access
                 // the socket anymore, and start a reconnect loop.
                 mIncoming.forget();
                 mReadWatcher.StopWatchingFileDescriptor();
                 mWriteWatcher.StopWatchingFileDescriptor();
                 close(mSocket.mFd);
                 mIOLoop->PostTask(FROM_HERE, new RilReconnectTask());
                 return;
             }
             mIncoming->mSize = ret;
             sConsumer->MessageReceived(mIncoming.forget());
-            if (ret < 1024) {
+            if (ret < RilRawData.MAX_DATA_SIZE) {
                 return;
             }
         }
     }
 }
 
 void
 RilClient::OnFileCanWriteWithoutBlocking(int fd)