Official eMule-Board: Is It Safe/correct To Purge M_Waitingpackets_List In ::disconnected? - Official eMule-Board

Jump to content

Page 1 of 1

Is It Safe/correct To Purge M_Waitingpackets_List In ::disconnected? to avoid unexpected exception & save memory usage

#1 User is offline   Enig123 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 506
  • Joined: 22-November 04

Posted 28 September 2016 - 05:43 AM

This question emerged when I got the following verbose log lines:
9/4/2016 1:32:07 PM: Requesting AICH Hash (HighId) from client xxx.201.157.209 'Badmac' (eMule v0.50a,OnQueue/OnUploadQueue/None)
9/4/2016 1:32:25 PM: AICH Request failed, Trying to ask another client (file xxx.avi, Part: 105, Client xxx.201.157.209 'Badmac' (eMule v0.50a,OnQueue/OnUploadQueue/None))
9/4/2016 3:10:17 PM: Download session started. User: xxx.201.157.209 'Badmac' (eMule v0.50a,OnQueue/OnUploadQueue/None) in SetDownloadState().
9/4/2016 3:10:18 PM: Error: Received unrequested AICH Packet - while processing eMule packet: opcode=OP_AICHANSWER  size=1186; Client=xxx.201.157.209 'Badmac' (eMule v0.50a,Downloading/OnUploadQueue/None)
9/4/2016 3:10:18 PM: Download session ended: ProcessExtPacket error. Received unrequested AICH Packet User: xxx.201.157.209 'Badmac' (eMule v0.50a,Downloading/OnUploadQueue/None) in SetDownloadState(). New State: 12, Length: 0 secs, Payload: 0 Bytes, Transferred: 0 Bytes, Req blocks not yet completed: 3.

As you can see, we got unexpected AICH packet when the download session started, and caused an exception which end the download session.

The problem is, when we tried to connect this client for AICH info, the connection failed to establish, thus the AICH request flag reset in CUpDownClient::Disconnected(), while the packet keep in m_WaitingPackets_list. Next time the remote client connected with us, the AICH request packet sent with flag remain false.

Should we just purge m_WaitingPackets_list when the CUpDownClient::Disconnected() invoked, without side effect? I am asking this because the memory occupation of eMule seems dropped a lot, if purging m_WaitingPackets_list in CUpDownClient::Disconnected().

This post has been edited by Enig123: 28 September 2016 - 05:45 AM


#2 User is offline   Some Support 

  • Last eMule
  • PipPipPipPipPipPipPip
  • Group: Yes
  • Posts: 3637
  • Joined: 27-June 03

Posted 28 September 2016 - 08:11 AM

Without checking the whole code: Yes it seems to make sense purging this list in Disconnected() and might be a small bug not doing so. I don't see any unintended side effects - this list is used to send packets which were queued to be send on the beginning of a connection try so it should be purged if that try fails. But again I didn't check/tested everything.

I don't see however that this would significantly change the memory usage. It's a somewhat rare case and the queued packets are never that many or big.

#3 User is offline   fox88 

  • Golden eMule
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 4631
  • Joined: 13-May 07

Posted 08 October 2016 - 08:02 PM

I inserted list cleaning with logging into CUpDownClient::Disconnected().
Not a single packet was logged in about two weeks - must be a very rare event.

But if the purging is to be used, there is another question.
WaitingPackets list could have packets related to chat, preview, AICH and firewall checking - both requests and answers.
Should all packets be purged or part of the queue could be kept - for example, chat and preview packets?

  • Member Options

Page 1 of 1

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users