Closed
Bug 26312
Opened 26 years ago
Closed 26 years ago
nsFileTransport does not support Offset writing.
Categories
(Core :: Networking, defect, P3)
Tracking
()
VERIFIED
INVALID
M14
People
(Reporter: yixiong.zou, Assigned: warrensomebody)
Details
Attachments
(1 file)
|
446 bytes,
patch
|
Details | Diff | Splinter Review |
The new nsFileTransport::OpenOutputStream does not work if you try to open the
file with an offset. The file will be zeroed out when the file got opened.
The following test case can verify this:
mozilla/netwerk/test/TestRawCache.
Run the "TestRawCache -f", this will generates assertion messages.
| Reporter | ||
Comment 1•26 years ago
|
||
The reason why this bug happens is in nsFileTransport::OpenOutputStream, it
uses the flag PR_TRUNCATE. This will zero out the file regard if it exists or
not. So adding a test statement can solve this problem
flag = PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE ;
if(startPosition)
flag = PR_WRONLY | PR_CREATE_FILE ;
rv = NS_NewFileOutputStream (mFile,
flags,
0664,
getter_AddRefs(str)) ;
| Reporter | ||
Comment 2•26 years ago
|
||
| Reporter | ||
Comment 3•26 years ago
|
||
I've send in a patch for this. Could anyone give it a review and check it in?
| Assignee | ||
Updated•26 years ago
|
Target Milestone: M14
| Assignee | ||
Comment 5•26 years ago
|
||
I think this bug is now invalid. Looks like dougt removed the truncate flag
altogether. However, in general, I want to pass the flags in to these calls as
a parameter which will take a little API tweakage.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•