imap protocol logging doesn't handle long lines

RESOLVED FIXED

Status

MailNews Core
Backend
RESOLVED FIXED
14 years ago
9 years ago

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Tracking

Trunk
x86
Windows 2000

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

14 years ago
because nspr logging limits line length to 512 bytes, IMAP protocol logging
misses out on some data, especially when doing an APPEND. Since we're having
trouble with fcc not completing on some servers for some users, it would be very
useful to see the whole data sent.
(Assignee)

Comment 1

14 years ago
Created attachment 139846 [details] [diff] [review]
proposed fix

this takes logData longer than 400 bytes and breaks it into 400 byte chunks,
and prints out all the data. This solution isn't perfect, because the pr log
dumps an extra CR every 400 bytes. The data passed in is const so we can't muck
with it in place. I suppose we could make a copy of it and then log it on a
per-line basis. Maybe I'll play with that, since the line endings could turn
out to be significant.
(Assignee)

Comment 2

14 years ago
Created attachment 139853 [details] [diff] [review]
fix that doesn't add newlines

This patch doesn't add extra newlines, and handles lines > 400 bytes (though
that does cause prlogging to add an extra newline, but we shouldn't be sending
lines > 400 bytes.
Attachment #139846 - Attachment is obsolete: true
(Assignee)

Updated

14 years ago
Attachment #139853 - Flags: superreview?(mscott)

Comment 3

14 years ago
David, is there anyway to only execute this new code if logging is turned on?
(Assignee)

Comment 4

14 years ago
It is only executed if logging is turned on - you can't see this from the diff,
but it's all inside 

if (PR_LOG_TEST(IMAP, PR_LOG_ALWAYS))
{
...
}

In my tree, I've changed the initial strlen to PL_strlen because PL_strlen
checks for null, and logData can be null.
Status: NEW → ASSIGNED

Comment 5

14 years ago
Comment on attachment 139853 [details] [diff] [review]
fix that doesn't add newlines

cool. thanks for the clarification.
Attachment #139853 - Flags: superreview?(mscott) → superreview+
(Assignee)

Comment 6

14 years ago
fix checked in.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.