Closed nazar closed 13 years ago
Hi Ditesh.
Thank you for the library.
I've encountered a situation where POP3Client.prototype.uidl get stuck in a loop.
while(true) { if ( (offset > endOffset) break; newoffset = data.indexOf("\r\n", offset); listitem = data.substr(offset, newoffset-offset); listitem = listitem.split(" "); returnValue[listitem[0]] = listitem[1]; offset = newoffset + 2; }
the (offset > endOffSet) is never met as when the last item is added offset is smaller than endOffset.
I patched it as follows:
while(true) { if ( (offset > endOffset) || (newoffset == -1) ) break; newoffset = data.indexOf("\r\n", offset); listitem = data.substr(offset, newoffset-offset); listitem = listitem.split(" "); returnValue[listitem[0]] = listitem[1]; offset = newoffset + 2; }
There might be a better way.
HTH
Thanks for the feedback. I've committed a fix.
Could you help test out commit https://github.com/ditesh/node-poplib/commit/269e36fb57660caf56152b7ba9d041906eb51932 ?
Released 0.1.4, with several other fixes.
Hi Ditesh.
Thank you for the library.
I've encountered a situation where POP3Client.prototype.uidl get stuck in a loop.
the (offset > endOffSet) is never met as when the last item is added offset is smaller than endOffset.
I patched it as follows:
There might be a better way.
HTH