Merged changes from default branch

This commit is contained in:
Andrew Johnson
2014-04-18 16:55:13 -05:00
2 changed files with 25 additions and 13 deletions

View File

@@ -308,15 +308,8 @@ void DefaultPVArray<T>::deserialize(ByteBuffer *pbuffer,
const size_t available = have_bytes/sizeof(T);
if(available == 0) {
size_t want = sizeof(T);
if(remaining==1 && sizeof(T)>1) {
// Need to wait for the last few bytes
// of the final element.
// available==0 implies have_bytes<sizeof(T)
want = sizeof(T) - have_bytes;
}
// recv() at least one element, or remaining buffer
pcontrol->ensureData(want);
// get at least one element
pcontrol->ensureData(sizeof(T));
continue;
}