mirror of
https://github.com/moparisthebest/k-9
synced 2024-11-24 02:12:15 -05:00
- Reworked the previous patch with suggestions by jessev to be as runtime/memory efficient as possible without being useless.
- Output debug message when invalid responses are encountered.
This commit is contained in:
parent
b9b15295cd
commit
a85ea2ee53
@ -936,25 +936,21 @@ public class ImapStore extends Store
|
|||||||
*
|
*
|
||||||
* See issue 2078
|
* See issue 2078
|
||||||
*/
|
*/
|
||||||
|
boolean invalidResponse = false;
|
||||||
for (int i = 1, length = response.size(); i < length; i++)
|
for (int i = 1, length = response.size(); i < length; i++)
|
||||||
{
|
{
|
||||||
Object item = response.get(i);
|
if ("0".equals(response.get(i)))
|
||||||
if (item instanceof String)
|
|
||||||
{
|
{
|
||||||
try
|
invalidResponse = true;
|
||||||
{
|
|
||||||
// Message sequence number is an unsigned 32-bit number.
|
|
||||||
long msgSeqNum = Long.parseLong((String)item);
|
|
||||||
|
|
||||||
// TODO: Make sure the number isn't larger than the number of
|
|
||||||
// messages in the folder rather than < 2^32.
|
|
||||||
if ((msgSeqNum > 0) && (msgSeqNum < (1L << 32)))
|
|
||||||
{
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch (NumberFormatException e) {}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (K9.DEBUG && invalidResponse)
|
||||||
|
{
|
||||||
|
Log.d(K9.LOG_TAG, "Invalid value found in SEARCH response.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user