|
Lines 500-513
TcpSocketImpl::Recv (uint32_t maxSize, u
|
Link Here
|
|---|
|
| 500 |
return 0; |
500 |
return 0; |
| 501 |
} |
501 |
} |
| 502 |
Ptr<Packet> outPacket = Create<Packet>(); |
502 |
Ptr<Packet> outPacket = Create<Packet>(); |
|
|
503 |
bool good = true; |
| 503 |
for(i = out.begin(); i!=out.end(); ++i) |
504 |
for(i = out.begin(); i!=out.end(); ++i) |
| 504 |
{ |
505 |
{ |
| 505 |
if (outPacket->GetSize() + i->second->GetSize() <= maxSize ) |
506 |
if (outPacket->GetSize() + i->second->GetSize() <= maxSize ) |
| 506 |
{ |
507 |
{ |
|
|
508 |
// If you trigger this assert, please attach a testcase |
| 509 |
// to bug 238 on http://www.nsnam.org/bugzilla |
| 510 |
NS_ASSERT (good); |
| 507 |
outPacket->AddAtEnd(i->second); |
511 |
outPacket->AddAtEnd(i->second); |
| 508 |
} |
512 |
} |
| 509 |
else |
513 |
else |
| 510 |
{ |
514 |
{ |
|
|
515 |
good = false; |
| 511 |
//only append as much as will fit |
516 |
//only append as much as will fit |
| 512 |
uint32_t avail = maxSize - outPacket->GetSize(); |
517 |
uint32_t avail = maxSize - outPacket->GetSize(); |
| 513 |
outPacket->AddAtEnd(i->second->CreateFragment(0,avail)); |
518 |
outPacket->AddAtEnd(i->second->CreateFragment(0,avail)); |