aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Wrong uploading  (Read 1412 times)

eMulePlus

  • Newbie
  • Karma: 0
  • Offline Offline
  • Posts: 2
Wrong uploading
« on: September 21, 2005, 05:51:08 AM »

You need to add the following code from the official client. Otherwise in some cases aMule starts to upload before it receives actual data request...

Code: [Select]
bool CUpDownClient::Disconnected(LPCTSTR pszReason, bool bFromSocket)
{
...
// 28-Jun-2004 [bc]: re-applied this patch which was in 0.30b-0.30e. it does not seem to solve the bug but
// it does not hurt either...
if (m_BlockRequests_queue.GetCount() > 0 || m_DoneBlocks_list.GetCount()){
// Although this should not happen, it seems(?) to happens sometimes. The problem we may run into here is as follows:
//
// 1.) If we do not clear the block send requests for that client, we will send those blocks next time the client
// gets an upload slot. But because we are starting to send any available block send requests right _before_ the
// remote client had a chance to prepare to deal with them, the first sent blocks will get dropped by the client.
// Worst thing here is, because the blocks are zipped and can therefore only be uncompressed when the first block
// was received, all of those sent blocks will create a lot of uncompress errors at the remote client.
//
// 2.) The remote client may have already received those blocks from some other client when it gets the next
// upload slot.
        DebugLogWarning(_T("Disconnected client with non empty block send queue; %s reqs: %s doneblocks: %s"), DbgGetClientInfo(), m_BlockRequests_queue.GetCount() > 0 ? _T("true") : _T("false"), m_DoneBlocks_list.GetCount() ? _T("true") : _T("false"));
ClearUploadBlockRequests();
}
...
}
Logged