Added all the nucache files to the memory module project (as a group) so that NU_CACHE can be turned on with a flick of the wrist, made the modular memory library build with the NU_CACHE flag turned on, fixed build warnings and errors. The NU_CACHE flag is still OFF, because the database code doesn't exist for Macintosh or Unix :-(

This commit is contained in:
mcmullen%netscape.com 1999-01-14 23:21:06 +00:00
Родитель 60b66fd905
Коммит df728321d8
13 изменённых файлов: 31 добавлений и 59 удалений

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

@ -72,12 +72,12 @@ XP_GetBuiltinString(int16 i)
if
(
((ret = mcom_include_merrors_i_strings (i))) ||
((ret = mcom_include_secerr_i_strings (i))) ||
((ret = mcom_include_sec_dialog_strings(i))) ||
((ret = mcom_include_sslerr_i_strings (i))) ||
((ret = mcom_include_xp_error_i_strings(i))) ||
((ret = mcom_include_xp_msg_i_strings (i)))
((ret = mcom_include_merrors_i_strings (i)) != 0) ||
((ret = mcom_include_secerr_i_strings (i)) != 0) ||
((ret = mcom_include_sec_dialog_strings(i)) != 0) ||
((ret = mcom_include_sslerr_i_strings (i)) != 0) ||
((ret = mcom_include_xp_error_i_strings(i)) != 0) ||
((ret = mcom_include_xp_msg_i_strings (i)) != 0)
)
{
return ret;

41
network/cache/nu/src/nsCachePref.cpp поставляемый
Просмотреть файл

@ -113,50 +113,19 @@ nsCachePref::SetupPrefs(const char* i_Pref)
if (bSetupAll || !PL_strcmp(i_Pref,CACHE_DIR_PREF))
{
#ifdef XP_MAC
tempPref = CPrefs::GetCachePath();
if (tempPref)
{
if (m_DiskCacheFolder)
delete m_DiskCacheFolder;
if (PREF_OK == PREF_CopyPathPref(CACHE_DIR_PREF,&tempPref))
{
PR_ASSERT(tempPref);
delete [] m_DiskCacheFolder;
m_DiskCacheFolder = new char[PL_strlen(tempPref)+2];
if (!m_DiskCacheFolder)
{
if (tempPref)
PR_Free(tempPref);
return;
}
/* Changing the mac path to unix because nspr converts
it the other way round and cant deal with it being a mac path */
m_DiskCacheFolder[0]='/';
m_DiskCacheFolder[1]='\0';
PL_strcat(m_DiskCacheFolder, tempPref);
char *tempPref2 = m_DiskCacheFolder+1;
while (*tempPref2)
{
if (*tempPref2 == ':')
*tempPref2 = '/';
tempPref2++;
}
}
#else
if (PREF_OK == PREF_CopyCharPref(CACHE_DIR_PREF,&tempPref))
{
PR_ASSERT(tempPref);
if (m_DiskCacheFolder)
delete m_DiskCacheFolder;
m_DiskCacheFolder = new char[PL_strlen(tempPref)+1];
if (!m_DiskCacheFolder)
{
if (tempPref)
PR_Free(tempPref);
return;
}
PL_strcpy(m_DiskCacheFolder, tempPref);
}
#endif
}
else //TODO set to temp folder
{
#if defined(MODULAR_NETLIB) && defined(XP_PC)

Двоичные данные
network/macbuild/network.mcp

Двоичный файл не отображается.

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

@ -55,6 +55,7 @@
#include "jsapi.h"
#include "jscompat.h"
#include "jspubtd.h"
#include "jsautocf.h"
/* for XP_GetString() */
#include "xpgetstr.h"

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

@ -2982,7 +2982,7 @@ redo_load_switch: /* come here on file/ftp retry */
this_entry->proxy_conf,
&this_entry->proxy_addr,
&this_entry->socks_host,
&this_entry->socks_port))
&this_entry->socks_port)) != 0
&& this_entry->proxy_addr
)
{

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

@ -607,7 +607,7 @@ NET_DumpDecoders()
net_ConverterStruct * cs_ptr;
XP_List *list_ptr = net_decoder_list[FO_PRESENT];
while((cs_ptr = XP_ListNextObject(list_ptr)))
while((cs_ptr = XP_ListNextObject(list_ptr)) != 0)
{
char *msg = PR_smprintf("in: %s out: %d\n",cs_ptr->encoding_in, cs_ptr->format_out);

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

@ -19,6 +19,7 @@
#include "nsIProtocolURLFactory.h"
#include "nsHttpUrl.h"
#include "nsINetService.h"
#include "nsNetThread.h"
#include "nsIServiceManager.h"
#include "nsString.h"

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

@ -30,8 +30,7 @@
#include "prmem.h"
#include "plstr.h"
#include "nsCRT.h"
MWContext *new_stub_context(URL_Struct *URL_s);
#include "nsStubContext.h"
static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID);

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

@ -68,6 +68,7 @@ public:
};
extern "C" void RL_Init();
extern "C" nsIRelatedLinks * NS_NewRelatedLinks();
#endif

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

@ -21,6 +21,7 @@
#include "nsISupports.h"
#include "nsINetService.h"
#include "nsNetService.h"
#include "nsRepository.h"
/* This implementation of the network service factory is presently
* only taking advantage of the service retrieval benefit that the

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

@ -79,7 +79,7 @@ static PRHashTable *net_AboutTable = NULL;
PRIVATE PRIntn net_AboutComparator(const void *v1, const void *v2)
{
char *idx = NULL;
if (idx = PL_strchr((char *) v1, '?')) {
if ((idx = PL_strchr((char *) v1, '?')) != 0) {
int len = (int)(idx - (char *) v1);
return PL_strncasecmp((char *) v1, (char *) v2, len) == 0;
} else {
@ -101,7 +101,7 @@ PRIVATE PLHashNumber net_HashAbout(const void *key)
PRIVATE PRBool net_DoRegisteredAbout(const char *which, ActiveEntry *entry)
{
NET_AboutCB cb;
if (cb = (NET_AboutCB) PL_HashTableLookup(net_AboutTable, which)) {
if ((cb = (NET_AboutCB) PL_HashTableLookup(net_AboutTable, which))!= 0) {
return cb(which, entry->format_out, entry->URL_s, entry->window_id);
}
return PR_FALSE;
@ -138,7 +138,7 @@ net_OutputURLDocInfo(MWContext *ctxt, char *which, char **data, int32 *length)
char buf[64];
char *tmp=0;
char *escaped;
char *sec_msg, *il_msg;
char *il_msg;
NET_FindURLInCache(URL_s, ctxt);

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

@ -216,7 +216,7 @@ net_CheckForAuthorization(char * address, Bool exact_match)
* http://uname:pwd@host.com, so make sure we don't compare an address
* passed in with one with an auth struct->path until we remove/reduce the
* address passed in. */
if( (afterProto=PL_strstr(address, "://")) ) {
if( (afterProto=PL_strstr(address, "://")) != 0 ) {
afterProto=afterProto+3;
tmp=*afterProto;
*afterProto='\0';
@ -224,7 +224,7 @@ net_CheckForAuthorization(char * address, Bool exact_match)
*afterProto=tmp;
/* temporarily truncate after first slash, if any. */
if( (fSlash=PL_strchr(afterProto, '/')) )
if( (fSlash=PL_strchr(afterProto, '/')) != 0)
*fSlash='\0';
atSign=PL_strchr(afterProto, '@');
if(fSlash)
@ -915,8 +915,8 @@ NET_AskForAuthString(MWContext *context,
prev_auth->password = password;
prev_auth->path = 0;
/* Don't save username/password info in the auth struct path. */
if( (atSign=PL_strchr(new_address, '@')) ) {
if( (host=PL_strstr(new_address, "://")) ) {
if( (atSign=PL_strchr(new_address, '@')) != 0) {
if( (host=PL_strstr(new_address, "://")) != 0) {
char tmp;
host+=3;
tmp=*host;

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

@ -88,7 +88,7 @@ extern int XP_PROGRESS_TRYAGAIN;
extern int XP_PROGRESS_WAIT_REPLY;
extern int XP_HR_TRANSFER_INTERRUPTED;
extern int XP_TRANSFER_INTERRUPTED;
extern int XP_ERRNO_EIO;
extern int XP_ERRNO_EIO;
#ifdef TRUST_LABELS
extern void ProcessCookiesAndTrustLabels( ActiveEntry *ce );
@ -1264,9 +1264,9 @@ net_build_http_request (URL_Struct * URL_s,
char *atSign=NULL;
char *path=NULL;
if( (path=PL_strchr(colon+3, '/')) )
if( (path=PL_strchr(colon+3, '/')) != 0)
*path='\0';
if( (atSign=PL_strchr(colon, '@')) ) {
if( (atSign=PL_strchr(colon, '@')) != 0) {
/* We found a username and/or a password, don't let it through */
char temp;
if(path)
@ -1467,7 +1467,7 @@ net_build_http_request (URL_Struct * URL_s,
/* Figure out which kind of proxy we're using: PAC or straight proxy.
* DON'T FREE tempURL!!!
*/
if ( (tempURL = net_GetPACUrl()) && (*tempURL) )
if ( (tempURL = net_GetPACUrl()) != NULL && (*tempURL) )
proxyServer = NET_ParseURL(tempURL,
GET_HOST_PART
| GET_PATH_PART
@ -2545,7 +2545,7 @@ net_setup_http_stream(ActiveEntry * ce) {
/* Figure out which kind of proxy we're using: PAC or straight proxy.
* DON'T FREE tempURL!!!
*/
if ( (tempURL = net_GetPACUrl()) && (*tempURL) )
if ( (tempURL = net_GetPACUrl()) != NULL && (*tempURL) )
proxyServer = NET_ParseURL(tempURL, GET_HOST_PART | GET_PATH_PART | GET_USERNAME_PART | GET_PASSWORD_PART);
else
proxyServer = cd->proxy_server;
@ -3788,7 +3788,7 @@ HTTP_ReadPrefs(void)
NET_SetSendRefererHeader(b);
}
MODULE_PRIVATE int PR_CALLBACK HTTP_PrefChangedFunc(const char *pref, void *data)
static int PR_CALLBACK HTTP_PrefChangedFunc(const char *pref, void *data)
{
HTTP_ReadPrefs();
return TRUE;