Kaydet (Commit) 12310746 authored tarafından Caolán McNamara's avatar Caolán McNamara

accumulate into an OStringBuffer

üst 2d152606
...@@ -669,22 +669,24 @@ void OfficeIPCThread::execute() ...@@ -669,22 +669,24 @@ void OfficeIPCThread::execute()
// down during wait // down during wait
osl::ClearableMutexGuard aGuard( GetMutex() ); osl::ClearableMutexGuard aGuard( GetMutex() );
ByteString aArguments;
// test byte by byte // test byte by byte
const int nBufSz = 2048; const int nBufSz = 2048;
char pBuf[nBufSz]; char pBuf[nBufSz];
int nBytes = 0; int nBytes = 0;
int nResult = 0; int nResult = 0;
rtl::OStringBuffer aBuf;
// read into pBuf until '\0' is read or read-error // read into pBuf until '\0' is read or read-error
while ((nResult=maStreamPipe.recv( pBuf+nBytes, nBufSz-nBytes))>0) { while ((nResult=maStreamPipe.recv( pBuf+nBytes, nBufSz-nBytes))>0) {
nBytes += nResult; nBytes += nResult;
if (pBuf[nBytes-1]=='\0') { if (pBuf[nBytes-1]=='\0') {
aArguments += pBuf; aBuf.append(pBuf);
break; break;
} }
} }
// don't close pipe ... // don't close pipe ...
ByteString aArguments = aBuf.makeStringAndClear();
// Is this a lookup message from another application? if so, ignore // Is this a lookup message from another application? if so, ignore
if ( aArguments.Len() == 0 ) if ( aArguments.Len() == 0 )
continue; continue;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment