mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 12:35:58 +00:00
fix for #39862. backend support for push (force) authentication for news.
sorry, no UI yet. thanks to ayn2@cornell.edu for the patch. r/sr=sspitzer
This commit is contained in:
parent
9f0b7149a8
commit
89d2112b5b
@ -256,6 +256,7 @@ pref("mail.server.default.delete_model", 1);
|
||||
pref("mail.server.default.fetch_by_chunks", true);
|
||||
pref("mail.server.default.mime_parts_on_demand", true);
|
||||
|
||||
pref("mail.server.default.always_authenticate",false);
|
||||
pref("mail.server.default.max_articles", 500);
|
||||
pref("mail.server.default.notify.on", true);
|
||||
pref("mail.server.default.mark_old_read", false);
|
||||
|
@ -108,12 +108,12 @@
|
||||
#define RATE_STR_BUF_LEN 32
|
||||
#define UPDATE_THRESHHOLD 25600 /* only update every 25 KB */
|
||||
|
||||
// neither push auth nor extensions are supported yet
|
||||
// since there is a lot of work to do on the news code
|
||||
// for example, nsNNTPHost and nsNNTPNewgroup are
|
||||
// going away. until then, after doing "mode reader"
|
||||
// skip to the first nntp command.
|
||||
//#define HAVE_PUSH_AUTH_AND_EXTENSIONS
|
||||
// NNTP extensions are supported yet
|
||||
// until the extension code is ported,
|
||||
// we'll skip right to the first nntp command
|
||||
// after doing "mode reader"
|
||||
// and "pushed" authentication (if necessary),
|
||||
//#define HAVE_NNTP_EXTENSIONS
|
||||
|
||||
// ***jt -- the following were pirated from xpcom/io/nsByteBufferInputStream
|
||||
// which is not currently in the build system
|
||||
@ -1564,7 +1564,6 @@ PRInt32 nsNNTPProtocol::SendModeReaderResponse()
|
||||
{
|
||||
SetFlag(NNTP_READER_PERFORMED);
|
||||
|
||||
#ifdef HAVE_PUSH_AUTH_AND_EXTENSIONS
|
||||
/* ignore the response code and continue
|
||||
*/
|
||||
PRBool pushAuth;
|
||||
@ -1575,10 +1574,11 @@ PRInt32 nsNNTPProtocol::SendModeReaderResponse()
|
||||
*/
|
||||
m_nextState = NNTP_BEGIN_AUTHORIZE;
|
||||
else
|
||||
#ifdef HAVE_NNTP_EXTENSIONS
|
||||
m_nextState = SEND_LIST_EXTENSIONS;
|
||||
#else
|
||||
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
||||
#endif /* HAVE_PUSH_AUTH_AND_EXTENSIONS */
|
||||
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
||||
#endif /* HAVE_NNTP_EXTENSIONS */
|
||||
|
||||
return(0);
|
||||
}
|
||||
@ -2790,7 +2790,7 @@ PRInt32 nsNNTPProtocol::AuthorizationResponse()
|
||||
MK_NNTP_RESPONSE_AUTHINFO_SIMPLE_OK == m_responseCode)
|
||||
{
|
||||
/* successful login */
|
||||
#ifdef HAVE_PUSH_AUTH_AND_EXTENSIONS
|
||||
#ifdef HAVE_NNTP_EXTENSIONS
|
||||
PRBool pushAuth;
|
||||
/* If we're here because the host demanded authentication before we
|
||||
* even sent a single command, then jump back to the beginning of everything
|
||||
@ -2812,7 +2812,7 @@ PRInt32 nsNNTPProtocol::AuthorizationResponse()
|
||||
m_nextState = NNTP_SEND_MODE_READER;
|
||||
else
|
||||
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
||||
#endif /* HAVE_PUSH_AUTH_AND_EXTENSIONS */
|
||||
#endif /* HAVE_NNTP_EXTENSIONS */
|
||||
|
||||
return(0);
|
||||
}
|
||||
@ -2914,7 +2914,7 @@ PRInt32 nsNNTPProtocol::PasswordResponse()
|
||||
MK_NNTP_RESPONSE_AUTHINFO_SIMPLE_OK == m_responseCode)
|
||||
{
|
||||
/* successful login */
|
||||
#ifdef HAVE_PUSH_AUTH_AND_EXTENSIONS
|
||||
#ifdef HAVE_NNTP_EXTENSIONS
|
||||
PRBool pushAuth;
|
||||
/* If we're here because the host demanded authentication before we
|
||||
* even sent a single command, then jump back to the beginning of everything
|
||||
@ -2936,7 +2936,7 @@ PRInt32 nsNNTPProtocol::PasswordResponse()
|
||||
m_nextState = NNTP_SEND_MODE_READER;
|
||||
else
|
||||
m_nextState = SEND_FIRST_NNTP_COMMAND;
|
||||
#endif /* HAVE_PUSH_AUTH_AND_EXTENSIONS */
|
||||
#endif /* HAVE_NNTP_EXTENSIONS */
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
@ -92,7 +92,6 @@ nsNntpIncomingServer::nsNntpIncomingServer() : nsMsgLineBuffer(nsnull, PR_FALSE)
|
||||
|
||||
mLastGroupDate = 0;
|
||||
mUniqueId = 0;
|
||||
mPushAuth = PR_FALSE;
|
||||
mHasSeenBeginGroups = PR_FALSE;
|
||||
mPostingAllowed = PR_FALSE;
|
||||
mLastUpdatedTime = 0;
|
||||
@ -134,6 +133,7 @@ nsNntpIncomingServer::~nsNntpIncomingServer()
|
||||
NS_IMPL_SERVERPREF_BOOL(nsNntpIncomingServer, NotifyOn, "notify.on");
|
||||
NS_IMPL_SERVERPREF_BOOL(nsNntpIncomingServer, MarkOldRead, "mark_old_read");
|
||||
NS_IMPL_SERVERPREF_BOOL(nsNntpIncomingServer, Abbreviate, "abbreviate");
|
||||
NS_IMPL_SERVERPREF_BOOL(nsNntpIncomingServer, PushAuth, "always_authenticate");
|
||||
NS_IMPL_SERVERPREF_INT(nsNntpIncomingServer, MaxArticles, "max_articles");
|
||||
|
||||
NS_IMETHODIMP
|
||||
@ -825,7 +825,6 @@ nsNntpIncomingServer::WriteHostInfoFile()
|
||||
*mHostInfoStream << "lastgroupdate=" << mLastGroupDate << MSG_LINEBREAK;
|
||||
*mHostInfoStream << "firstnewdate=" << firstnewdate << MSG_LINEBREAK;
|
||||
*mHostInfoStream << "uniqueid=" << mUniqueId << MSG_LINEBREAK;
|
||||
*mHostInfoStream << "pushauth=" << mPushAuth << MSG_LINEBREAK;
|
||||
*mHostInfoStream << "" << MSG_LINEBREAK;
|
||||
*mHostInfoStream << "begingroups" << MSG_LINEBREAK;
|
||||
|
||||
@ -1232,8 +1231,6 @@ nsNntpIncomingServer::HandleLine(char* line, PRUint32 line_size)
|
||||
LL_I2L(mFirstNewDate, firstnewdate);
|
||||
} else if (PL_strcmp(line, "uniqueid") == 0) {
|
||||
mUniqueId = strtol(equalPos, nsnull, 16);
|
||||
} else if (PL_strcmp(line, "pushauth") == 0) {
|
||||
mPushAuth = strtol(equalPos, nsnull, 16);
|
||||
} else if (PL_strcmp(line, "version") == 0) {
|
||||
mVersion = strtol(equalPos, nsnull, 16);
|
||||
}
|
||||
@ -1433,20 +1430,6 @@ nsNntpIncomingServer::SetPostingAllowed(PRBool aPostingAllowed)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNntpIncomingServer::GetPushAuth(PRBool *aPushAuth)
|
||||
{
|
||||
NS_ASSERTION(0,"not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNntpIncomingServer::SetPushAuth(PRBool aPushAuth)
|
||||
{
|
||||
NS_ASSERTION(0,"not implemented");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNntpIncomingServer::GetLastUpdatedTime(PRUint32 *aLastUpdatedTime)
|
||||
{
|
||||
|
@ -128,7 +128,6 @@ private:
|
||||
PRUint32 mLastGroupDate;
|
||||
PRTime mFirstNewDate;
|
||||
PRInt32 mUniqueId;
|
||||
PRBool mPushAuth;
|
||||
PRUint32 mLastUpdatedTime;
|
||||
PRInt32 mVersion;
|
||||
PRBool mPostingAllowed;
|
||||
|
@ -256,6 +256,7 @@ pref("mail.server.default.delete_model", 1);
|
||||
pref("mail.server.default.fetch_by_chunks", true);
|
||||
pref("mail.server.default.mime_parts_on_demand", true);
|
||||
|
||||
pref("mail.server.default.always_authenticate",false);
|
||||
pref("mail.server.default.max_articles", 500);
|
||||
pref("mail.server.default.notify.on", true);
|
||||
pref("mail.server.default.mark_old_read", false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user