Closed Bug 232129 Opened 21 years ago Closed 21 years ago

imap protocol logging doesn't handle long lines

Categories

(MailNews Core :: Backend, defect)

x86
Windows 2000
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Bienvenu, Assigned: Bienvenu)

Details

Attachments

(1 file, 1 obsolete file)

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.
Attached patch proposed fix (obsolete) — Splinter Review
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.
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
Attachment #139853 - Flags: superreview?(mscott)
David, is there anyway to only execute this new code if logging is turned on?
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 on attachment 139853 [details] [diff] [review]
fix that doesn't add newlines

cool. thanks for the clarification.
Attachment #139853 - Flags: superreview?(mscott) → superreview+
fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 21 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.

Attachment

General

Created:
Updated:
Size: