mirror of
https://github.com/moparisthebest/davmail
synced 2024-12-13 11:12:22 -05:00
Dav: Log message download progress
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@1680 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
064708cff0
commit
3a058507c9
@ -2564,6 +2564,18 @@ public class DavExchangeSession extends ExchangeSession {
|
||||
inputStream = method.getResponseBodyAsStream();
|
||||
}
|
||||
inputStream = new FilterInputStream(inputStream) {
|
||||
int totalCount;
|
||||
int lastLogCount;
|
||||
|
||||
public int read(byte buffer[], int offset, int length) throws IOException {
|
||||
int count = super.read(buffer, offset, length);
|
||||
totalCount += count;
|
||||
if (totalCount - lastLogCount > 1024*1024) {
|
||||
LOGGER.debug("Downloaded " + (totalCount/1024) + " KBytes from " + method.getURI());
|
||||
lastLogCount = totalCount;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
|
Loading…
Reference in New Issue
Block a user