| 493 | |
| 494 | |
| 495 | void CUpDownClient::SendOutOfPartReqsAndAddToWaitingQueue() |
| 496 | { |
| 497 | // Kry - this is actually taken from eMule, but makes a lot of sense ;) |
| 498 | |
| 499 | //OP_OUTOFPARTREQS will tell the downloading client to go back to OnQueue.. |
| 500 | //The main reason for this is that if we put the client back on queue and it goes |
| 501 | //back to the upload before the socket times out... We get a situation where the |
| 502 | //downloader thinks it already sent the requested blocks and the uploader thinks |
| 503 | //the downloader didn't send any request blocks. Then the connection times out.. |
| 504 | //I did some tests with eDonkey also and it seems to work well with them also.. |
| 505 | |
| 506 | // Send this immediately, don't queue. |
| 507 | CPacket* pPacket = new CPacket(OP_OUTOFPARTREQS, 0, OP_EDONKEYPROT); |
| 508 | theStats::AddUpOverheadFileRequest(pPacket->GetPacketSize()); |
| 509 | AddDebugLogLineN( logLocalClient, "Local Client: OP_OUTOFPARTREQS to " + GetFullIP() ); |
| 510 | SendPacket(pPacket, true, true); |
| 511 | |
| 512 | theApp->uploadqueue->AddClientToQueue(this); |
| 513 | } |
| 514 | |
| 515 | |
| 516 | /** |
nothing calls this directly
no test coverage detected