rlebeau on master
Patch from fpctuxe to make TIdS… (compare)
rlebeau on master
Updating TIdIMAP4.RetrieveHeade… (compare)
rlebeau on master
#53 adding some extra parenthes… (compare)
I have anothe question. We have in TIdIOHandlerStack.Connected
ReadFromSource(False, 0, False);
What indy is supposed to read here? Sometimes (vary rarely) my application based on RemObjects SuperTCPServer hangs there as there is nothing to read from server.
select()
function (which has been known to happen, despite the timeout - that is an OS issue, not an Indy issue).
@rlebeau ,
your comment makes sense in case if it hangs while calling Readable (ATimeout) in TIdIOHandler.ReadFromSource. But in reality it hangs inside call
LByteCount := ReadDataFromSource(LBuffer); a few lines below. I can imagine next multithread scenario:
1) first thread actively does IO over socket
2) second thread checks for connection and for this moment due activity of first thread Readable returns true.
3) Second thread calls ReadDataFromSource, but for this moment first thread fully has processed data => second thread hangs there.
Remobject's SuperTCPServer depends on Indy library and assumes that Indy10 supports multithread processing.
As for me fix should be in calling of just Readable inside TIdIOHandlerStack.Connected instead of ReadFromSource
@josdebr_twitter what is the EXACT error message? What does the call stack look like when the error occurs?
Hi Remy,
the exact error message is: "ERangeError raised: Range check error". I get the error after I call "IMAPClient.Retrieve(i, Msg)"
I've managed to generate a callstack, I can even get you a Eureka log file if you can read it. But here is the callstack extracted from my log:
IdGlobalProtocols.pas| |GetUniqueFileName |1644[45] |
IdGlobalProtocols.pas| |GetUniqueFileName |1599[0] |
IdGlobalProtocols.pas| |MakeTempFilename |1584[35] |
IdGlobalProtocols.pas| |MakeTempFilename |1549[0] |
IdAttachmentFile.pas |TIdAttachmentFile |PrepareTempStream |144[3] |
IdMessageClient.pas | |ProcessAttachment |840[7] |
IdMessageClient.pas | |ProcessAttachment |833[0] |
IdMessageClient.pas |TIdMessageClient |ReceiveBody |1024[115]|
IdMessageClient.pas |TIdMessageClient |ProcessMessage |1535[8] |
IdMessageClient.pas |TIdMessageClient |ProcessMessage |1527[0] |
IdMessageHelper.pas | |Internal_TIdMessageClientHelper_ProcessMessage|60[12] |
IdMessageHelper.pas | |Internal_TIdMessageClientHelper_ProcessMessage|48[0] |
IdMessageHelper.pas | |Internal_TIdMessageHelper_LoadFromStream |85[9] |
IdMessageHelper.pas | |Internal_TIdMessageHelper_LoadFromStream |76[0] |
IdMessageHelper.pas | |TIdMessageHelper_LoadFromStream |97[1] |
IdMessageHelper.pas | |TIdMessageHelper_LoadFromStream |96[0] |
IdIMAP4.pas |TIdIMAP4 |InternalRetrieve |4951[59] |
IdIMAP4.pas |TIdIMAP4 |InternalRetrieve |4892[0] |
IdIMAP4.pas |TIdIMAP4 |Retrieve |4601[2] |
IdIMAP4.pas |TIdIMAP4 |Retrieve |4599[0] |