mirror of
https://github.com/moparisthebest/k-9
synced 2025-02-17 07:30:16 -05:00
optimize cketti's pop3 space-splitting code to not make lots of extra
copies of responses.
This commit is contained in:
parent
de7624a92c
commit
1b7481f854
@ -459,9 +459,7 @@ public class Pop3Store extends Store {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Yet another work-around for buggy server software:
|
* Yet another work-around for buggy server software:
|
||||||
* Replace every occurence of multiple spaces with exactly one space. This way
|
* split the response into message number and unique identifier, no matter how many spaces it has
|
||||||
* the String.split() call below will have the desired effect, i.e. split the
|
|
||||||
* response into message number and unique identifier.
|
|
||||||
*
|
*
|
||||||
* Example for a malformed response:
|
* Example for a malformed response:
|
||||||
* 1 2011071307115510400ae3e9e00bmu9
|
* 1 2011071307115510400ae3e9e00bmu9
|
||||||
@ -469,9 +467,8 @@ public class Pop3Store extends Store {
|
|||||||
* Note the three spaces between message number and unique identifier.
|
* Note the three spaces between message number and unique identifier.
|
||||||
* See issue 3546
|
* See issue 3546
|
||||||
*/
|
*/
|
||||||
String cleanedResponse = response.replaceAll(" +", " ");
|
|
||||||
|
|
||||||
String[] uidParts = cleanedResponse.split(" ");
|
String[] uidParts = response.split(" +");
|
||||||
if ((uidParts.length >= 3) && "+OK".equals(uidParts[0])) {
|
if ((uidParts.length >= 3) && "+OK".equals(uidParts[0])) {
|
||||||
/*
|
/*
|
||||||
* At least one server software places a "+OK" in
|
* At least one server software places a "+OK" in
|
||||||
|
Loading…
Reference in New Issue
Block a user