This commit is contained in:
cyeh%netscape.com 1998-09-29 21:02:23 +00:00
Родитель 61c5e54cc3
Коммит eec5d10a4a
6 изменённых файлов: 11 добавлений и 135 удалений

Просмотреть файл

@ -43,9 +43,7 @@ net_CertLdapLoad(ActiveEntry *ce)
ce->status = err;
} else {
#endif
#ifdef NSPR20_DISABLED /* need to convert to PRFileDesc */
ce->socket = connData->fd;
#endif
PR_ASSERT(0);
#ifdef XP_UNIX

Просмотреть файл

@ -1109,9 +1109,7 @@ net_FileLoad (ActiveEntry * cur_entry)
char * cp;
FILEConData * con_data;
#ifndef NSPR20_DISABLED
NET_SetCallNetlibAllTheTime(CE_WINDOW_ID, "mkfile");
#endif /* NSPR20_DISABLED */
/* make space for the connection data */
cur_entry->con_data = PR_NEW(FILEConData);
@ -1331,9 +1329,7 @@ net_ProcessFile (ActiveEntry * cur_entry)
PR_FREEIF(con_data->stream);
PR_Free(cur_entry->con_data);
#ifndef NSPR20_DISABLED
NET_ClearCallNetlibAllTheTime(CE_WINDOW_ID, "mkfile");
#endif /* NSPR20_DISABLED */
return(-1); /* done */
}

Просмотреть файл

@ -1803,14 +1803,10 @@ net_get_ftp_file_mdtm_response(ActiveEntry * ce)
* xxx if present, is a fractional second and may be any length
* Time is expressed in UTC (GMT), not local time.
*/
#ifndef NSPR20
PRTime ts;
int64 t, s2us, st;
#else
PRExplodedTime ts;
int64 s2us, st;
PRTime t;
#endif /* NSPR20 */
time_t tt;
TRACEMSG(("Parsing MDTM \"%.1024s\"", cd->return_msg, CR, LF));
@ -1819,11 +1815,8 @@ net_get_ftp_file_mdtm_response(ActiveEntry * ce)
(cd->return_msg[1] - '0') * 100 +
(cd->return_msg[2] - '0') * 10 +
(cd->return_msg[3] - '0');
#ifndef NSPR20
ts.tm_mon = ((cd->return_msg[4] - '0') * 10 + (cd->return_msg[5] - '0')) - 1;
#else
ts.tm_month = ((cd->return_msg[4] - '0') * 10 + (cd->return_msg[5] - '0')) - 1;
#endif /* NSPR20 */
ts.tm_mday = (cd->return_msg[6] - '0') * 10 + (cd->return_msg[7] - '0');
ts.tm_hour = (cd->return_msg[8] - '0') * 10 + (cd->return_msg[9] - '0');
ts.tm_min = (cd->return_msg[10] - '0') * 10 + (cd->return_msg[11] - '0');
@ -1844,11 +1837,7 @@ net_get_ftp_file_mdtm_response(ActiveEntry * ce)
* }
*/
#ifndef NSPR20
t = PR_ComputeTime(&ts);
#else
t = PR_ImplodeTime(&ts);
#endif /* NSPR20 */
LL_I2L(s2us, PR_USEC_PER_SEC);
LL_DIV(st, t, s2us);
LL_L2I(tt, st);
@ -1856,19 +1845,10 @@ net_get_ftp_file_mdtm_response(ActiveEntry * ce)
#ifdef DEBUG
{
char line[256];
#ifndef NSPR20
PRTime et;
int64 t2;
#else
PRExplodedTime et;
PRTime t2;
#endif /* NSPR20 */
LL_MUL(t2, st, s2us);
#ifndef NSPR20
PR_ExplodeTime(&et, t2);
#else
PR_ExplodeTime(t2, PR_GMTParameters, &et);
#endif /* NSPR20 */
PR_FormatTimeUSEnglish(line, sizeof(line), "%Y%m%d%H%M%S", &et);
TRACEMSG(("Parse check: mdtm is \"%s\"", line));
}

Просмотреть файл

@ -1139,29 +1139,16 @@ net_build_http_request (URL_Struct * URL_s,
* use the NSPR time functions. URL_Struct should really be changed
* to use the NSPR time type instead of time_t.
*/
#ifndef NSPR20
uint64 timeInSec;
uint64 timeInUSec;
uint64 secToUSec;
PRTime expandedTime;
#else
PRTime timeInSec;
PRTime timeInUSec;
PRTime secToUSec;
PRExplodedTime expandedTime;
#endif /* NSPR20 */
LL_I2L(timeInSec, URL_s->last_modified);
LL_I2L(secToUSec, PR_USEC_PER_SEC);
LL_MUL(timeInUSec, timeInSec, secToUSec);
#ifndef NSPR20
#ifndef XP_MAC
timeInUSec = PR_ToGMT(timeInUSec);
#endif /* XP_MAC */
PR_ExplodeTime(&expandedTime, timeInUSec);
#else
PR_ExplodeTime(timeInUSec, PR_GMTParameters, &expandedTime);
#endif /* NSPR20 */
PR_FormatTimeUSEnglish(line_buffer, 400,
"If-Modified-Since: %a, %d %b %Y %H:%M:%S GMT",
&expandedTime);

Просмотреть файл

@ -37,22 +37,17 @@
#include "netutils.h"
#include "nslocks.h"
#ifdef NSPR20
#ifdef XP_MAC
#include "prpriv.h" /* for NewNamedMonitor */
#else
#include "private/prpriv.h"
#endif
#endif /* NSPR20 */
#define MAX_NEW_IMAP_FOLDER_COUNT 50
#define IMAP_DB_HEADERS "From To Cc Subject Date Priority X-Priority Message-ID References Newsgroups"
#ifndef NSPR20
#define IMAP_YIELD(A) PR_Yield()
#else
#define IMAP_YIELD(A) PR_Sleep(PR_INTERVAL_NO_WAIT)
#endif
extern "C"
{
@ -120,10 +115,8 @@ extern int XP_MSG_IMAP_LOGIN_FAILED;
extern void net_graceful_shutdown(PRFileDesc* sock, XP_Bool isSecure);
}
#ifdef NSPR20
extern PRLogModuleInfo* IMAP;
#define out PR_LOG_ALWAYS
#endif
static int32 gMIMEOnDemandThreshold = 15000;
static XP_Bool gMIMEOnDemand = FALSE;
@ -1644,12 +1637,7 @@ int WaitForFEEventLoopCount;
void TIMAP4BlockingConnection::WaitForIOCompletion()
{
#ifdef NSPR20
PRIntervalTime sleepTime = PR_MicrosecondsToInterval(kImapSleepTime);
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fIOMonitor);
fBlockedForIO = TRUE;
@ -2520,12 +2508,8 @@ void TNavigatorImapConnection::StartProcessingActiveEntries()
}
#ifndef NSPR20
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#else
PRIntervalTime sleepTime = PR_MicrosecondsToInterval(kImapSleepTime);
#endif
PR_EnterMonitor(fPermissionToDieMonitor);
while (!fIsSafeToDie)
PR_Wait(fPermissionToDieMonitor, sleepTime);
@ -2554,12 +2538,7 @@ void TNavigatorImapConnection::WaitForEventQueueEmptySignal()
// it does not wake up and check DeathSignalReceived()
// sometimes it is run after DeathSignalReceived and the thread
// has to drain its final fe events before death.
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fEventQueueEmptySignalMonitor);
while(!fEventQueueEmptySignalHappened)
@ -2578,12 +2557,7 @@ void TNavigatorImapConnection::SignalEventQueueEmpty()
void TNavigatorImapConnection::WaitForNextAppendMessageSize()
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fMsgCopyDataMonitor);
while(!fMsgAppendSizeIsNew && !DeathSignalReceived())
@ -2594,12 +2568,7 @@ void TNavigatorImapConnection::WaitForNextAppendMessageSize()
void TNavigatorImapConnection::WaitForPotentialListOfMsgsToFetch(uint32 **msgIdList, uint32 &msgCount)
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fMsgCopyDataMonitor);
while(!fFetchMsgListIsNew && !DeathSignalReceived())
@ -2625,12 +2594,7 @@ void TNavigatorImapConnection::NotifyKeyList(uint32 *keys, uint32 keyCount)
void TNavigatorImapConnection::WaitForMessageUploadToComplete()
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fMessageUploadMonitor);
while(!fMessageUploadCompleted && !DeathSignalReceived())
@ -2690,12 +2654,7 @@ void TNavigatorImapConnection::SetFolderInfo(MSG_FolderInfo *folder, XP_Bool fol
void TNavigatorImapConnection::WaitForNextActiveEntry()
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fActiveEntryMonitor);
while(!fNextEntryEventSignalHappened && !DeathSignalReceived())
@ -3899,12 +3858,7 @@ EMailboxDiscoverStatus TNavigatorImapConnection::GetMailboxDiscoveryStatus( )
void TNavigatorImapConnection::WaitForFEEventCompletion()
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fEventCompletionMonitor);
//#ifdef KMCENTEE_DEBUG
@ -3926,12 +3880,7 @@ void TNavigatorImapConnection::WaitForFEEventCompletion()
void TNavigatorImapConnection::WaitForTunnelCompletion()
{
#ifdef NSPR20
PRIntervalTime sleepTime = kImapSleepTime;
#else
int64 sleepTime;
LL_I2L(sleepTime, kImapSleepTime);
#endif
PR_EnterMonitor(fTunnelCompletionMonitor);
@ -9470,11 +9419,8 @@ XP_Bool TNavigatorImapConnection::GetIOTunnellingEnabled()
PR_STATIC_CALLBACK(void)
#ifndef NSPR20
imap_thread_main_function(void *imapConnectionVoid, void *)
#else
imap_thread_main_function(void *imapConnectionVoid)
#endif /* NSPR20 */
{
TNavigatorImapConnection *imapConnection =
(TNavigatorImapConnection *) imapConnectionVoid;
@ -9640,27 +9586,14 @@ TNavigatorImapConnection::SetupConnection(ActiveEntry * ce, MSG_Master *master,
newConnection = TRUE;
// start the imap thread
#ifdef NSPR20
PRThread *imapThread = PR_CreateThread(PR_USER_THREAD, imap_thread_main_function, blockingConnection,
PR_PRIORITY_NORMAL, PR_LOCAL_THREAD, PR_UNJOINABLE_THREAD,
0); // standard stack
#else
PRThread *imapThread = PR_CreateThread("imapIOthread",
threadPriority,
0); // standard stack
#endif
// save the thread object so an IMAP interrupt will
// cause the TIMAP4BlockingConnection destructor to
// destroy it.
blockingConnection->SetBlockingThread(imapThread);
newConnectionData->netConnection = blockingConnection;
#ifndef NSPR20
PR_Start(imapThread, // thread to start
imap_thread_main_function, // first function to call
blockingConnection, // function argument
nil); // function argument
#endif
XP_Bool folderNeedsSubscribing = FALSE;
XP_Bool folderNeedsACLRefreshed = FALSE;

Просмотреть файл

@ -106,12 +106,7 @@ extern int MK_MSG_COLLABRA_DISABLED;
extern int MK_MSG_EXPIRE_NEWS_ARTICLES;
/* Logging stuff */
#ifndef NSPR20
PR_LOG_DEFINE(NNTP);
#define NNTP_LOG_READ(buf) PR_LOG(NNTP, out, ("Receiving: %s", buf))
#define NNTP_LOG_WRITE(buf) PR_LOG(NNTP, out, ("Sending: %s", buf))
#define NNTP_LOG_NOTE(buf) PR_LOG(NNTP, out, buf)
#else
PRLogModuleInfo* NNTP = NULL;
#define out PR_LOG_ALWAYS
@ -130,8 +125,6 @@ if (NNTP==NULL) \
NNTP = PR_NewLogModule("NNTP"); \
PR_LOG(NNTP, out, buf) ;
#endif /* NSPR20 */
/* Forward declarations */
static int net_xpat_send (ActiveEntry*);
static int net_list_pretty_names(ActiveEntry*);
@ -1225,11 +1218,8 @@ net_send_first_nntp_command (ActiveEntry *ce)
time_t last_update =
MSG_NewsgroupsLastUpdatedTime(cd->host);
char small_buf[64];
#ifndef NSPR20
PRTime expandedTime;
#else
PRExplodedTime expandedTime;
#endif /* NSPR20 */
if(!last_update)
{
@ -1247,11 +1237,8 @@ net_send_first_nntp_command (ActiveEntry *ce)
LL_I2L(timeInSec, last_update);
LL_I2L(secToUSec, PR_USEC_PER_SEC);
LL_MUL(timeInUSec, timeInSec, secToUSec);
#ifndef NSPR20
PR_ExplodeTime( &expandedTime, timeInUSec );
#else
PR_ExplodeTime(timeInUSec, PR_LocalTimeParameters, &expandedTime);
#endif /* NSPR20 */
}
PR_FormatTimeUSEnglish(small_buf, sizeof(small_buf),
"NEWGROUPS %y%m%d %H%M%S", &expandedTime);
@ -4256,11 +4243,6 @@ net_NewsLoad (ActiveEntry *ce)
goto FAIL;
}
#ifndef NSPR20
PR_LogInit (&NNTPLog);
#endif
if(!cd)
{
status = MK_OUT_OF_MEMORY;