зеркало из https://github.com/mozilla/pjs.git
Bug 353308, EACCES ignored: empty attachment
r=darin for xpcom changes, sr=mscott Patch contributed by Stefan Rijnhart
This commit is contained in:
Родитель
91cf6f7fdb
Коммит
bc76032543
|
@ -751,8 +751,20 @@ nsMsgSendPart::Write()
|
|||
while (!myStream.eof())
|
||||
{
|
||||
if ((status = myStream.read(buffer, MIME_BUFFER_SIZE)) < 0)
|
||||
goto FAIL;
|
||||
|
||||
{
|
||||
nsCOMPtr<nsIMsgSendReport> sendReport;
|
||||
m_state->GetSendReport(getter_AddRefs(sendReport));
|
||||
if (sendReport)
|
||||
{
|
||||
nsAutoString error_msg;
|
||||
nsAutoString path;
|
||||
NS_CopyNativeToUnicode(nsDependentCString(m_filespec->GetNativePathCString()), path);
|
||||
nsMsgBuildErrorMessageByID(NS_MSG_UNABLE_TO_OPEN_FILE, error_msg, &path, nsnull);
|
||||
sendReport->SetMessage(nsIMsgSendReport::process_Current, error_msg.get(), PR_FALSE);
|
||||
status = NS_MSG_UNABLE_TO_OPEN_FILE;
|
||||
goto FAIL;
|
||||
}
|
||||
}
|
||||
status = PushBody(buffer, status);
|
||||
if (status < 0)
|
||||
goto FAIL;
|
||||
|
|
|
@ -75,9 +75,11 @@ PRInt32 nsInputStream::read(void* s, PRInt32 n)
|
|||
if (!mInputStream)
|
||||
return 0;
|
||||
PRInt32 result = 0;
|
||||
mInputStream->Read((char*)s, n, (PRUint32*)&result);
|
||||
PRInt32 status = mInputStream->Read((char*)s, n, (PRUint32*)&result);
|
||||
if (result == 0)
|
||||
set_at_eof(PR_TRUE);
|
||||
if (status < 0)
|
||||
return (status);
|
||||
return result;
|
||||
} // nsInputStream::read
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче