projects
/
chaz
/
yoink
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2609532
)
bugfix: writing packets missing some bytes
author
Charles McGarvey
<chazmcgarvey@brokenzipper.com>
Thu, 13 May 2010 20:17:40 +0000
(14:17 -0600)
committer
Charles McGarvey
<chazmcgarvey@brokenzipper.com>
Thu, 13 May 2010 20:17:40 +0000
(14:17 -0600)
src/Moof/Packet.cc
patch
|
blob
|
history
diff --git
a/src/Moof/Packet.cc
b/src/Moof/Packet.cc
index 8862f29bc9ba918ef23fb4608d539681fbb4f90a..8cd45b53baff4e71a9e5ac5a4e3381ebb59972b4 100644
(file)
--- a/
src/Moof/Packet.cc
+++ b/
src/Moof/Packet.cc
@@
-216,14
+216,16
@@
size_t Packet::write(const void* bytes, size_t size)
size_t nBytes = std::min(size, mSize - mW);
if (!mBuffer || nBytes < size)
{
- int n
um
Pages = 1 + size / PAGE_SIZE;
- int newSize = mSize + n
um
Pages * PAGE_SIZE;
+ int nPages = 1 + size / PAGE_SIZE;
+ int newSize = mSize + nPages * PAGE_SIZE;
char* newBuffer = (char*)realloc(mBuffer, newSize);
if (newBuffer)
{
mBuffer = newBuffer;
mSize = newSize;
+ nBytes = size;
}
+ if (!mBuffer) return 0;
}
memcpy(&mBuffer[mW], bytes, nBytes);
mW += nBytes;
This page took
0.017615 seconds
and
4
git commands to generate.