I have downloaded the latest cvs and added your changes and my test message of 1.5meg is now
downloaded in 3 or 4 seconds compared to 3 minutes and 46 seconds.
My system is Java 1.4.1 on windows 2000. Will move to linux soon.
Had posted a message on the users email list and Noel was going to look into it.
Would be good for all those windows people having the same problem if this fix could be included in the next release.
Please post the solution on the on the users list when available.
Thanks again.
Regards,
Simon
Peter M. Goldstein wrote:
All,
This is a fix for the observed performance problem with POP3 on some
platform JVM combinations. Basically it amounts to adding a
BufferedOutputStream around the OutputStream produced by the socket.
This also seems to resolve this issue encountered by JRC (Randy),
although the reason for this is less clear.
As we are past code freeze, this requires a vote of the committers to be
accepted. I think the problem is severe enough (as it is impacting our
user community) and the fix is localized enough to merit a patch, so I
vote +1. Thoughts?
--Peter
------------------------------------------------------------------------
Index: jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java
===================================================================
RCS file: /home/cvs/jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java,v
retrieving revision 1.17
diff -u -r1.17 POP3Handler.java
--- jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java 2 Nov 2002 09:03:52 -0000 1.17
+++ jakarta-james/src/java/org/apache/james/pop3server/POP3Handler.java 12 Nov 2002 07:24:45 -0000
@@ -238,7 +238,7 @@
}
try {
- outs = socket.getOutputStream();
+ outs = new BufferedOutputStream(socket.getOutputStream(), 1024);
out = new InternetPrintWriter(outs, true);
state = AUTHENTICATION_READY;
user = "unknown";
@@ -846,8 +846,6 @@
writeLoggedFlushedResponse(responseString);
return;
}
- //?May be written as
- //return parseCommand("TOP " + num + " " + Integer.MAX_VALUE);?
try {
MailImpl mc = (MailImpl) userMailbox.elementAt(num);
if (mc != DELETED) {
@@ -859,6 +857,8 @@
theWatchdog,
theConfigData.getResetLength());
mc.writeMessageTo(nouts);
+ nouts.flush();
+ // TODO: Is this an extra CRLF?
out.println();
out.println(".");
out.flush();
@@ -888,7 +888,6 @@
responseString = responseBuffer.toString();
writeLoggedFlushedResponse(responseString);
}
- // -------------------------------------------?
} else {
responseString = ERR_RESPONSE;
writeLoggedFlushedResponse(responseString);
@@ -935,6 +934,7 @@
theWatchdog,
theConfigData.getResetLength());
mc.writeContentTo(nouts, lines);
+ nouts.flush();
out.println(".");
out.flush();
} else {
------------------------------------------------------------------------
--
To unsubscribe, e-mail: <mailto:james-dev-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:james-dev-help@;jakarta.apache.org>
-- To unsubscribe, e-mail: <mailto:james-dev-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:james-dev-help@;jakarta.apache.org>
