N2 landing... everybody run! duck! hide...! It really should be ok.

This commit is contained in:
gagan%netscape.com 1999-03-25 00:22:56 +00:00
Родитель fdfe711a50
Коммит dc83d61414
23 изменённых файлов: 73 добавлений и 858 удалений

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

@ -47,5 +47,4 @@
/* ...and define the Raptor specific things */
#define STANDALONE_IMAGE_LIB /* libimg */
#define MODULAR_NETLIB /* network */
#define MOZ_NGLAYOUT

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

@ -914,11 +914,7 @@ extern XP_Bool NET_HaveConverterForMimeType(char *content_type);
/* builds an outgoing stream and returns a stream class structure
* containing a stream function table
*/
#ifdef MODULAR_NETLIB
PR_EXTERN(NET_StreamClass *)
#else
extern NET_StreamClass *
#endif /* MODULAR_NETLIB */
NET_StreamBuilder (
FO_Present_Types format_out,
URL_Struct * anchor,

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

@ -337,10 +337,8 @@ struct MWContext_ {
/* if the window is displaying an XML file, keep a pointer to the XML file structure here */
void* xmlfile;
Bool anonymous;
#ifdef MODULAR_NETLIB
URL_Struct* modular_data;
PRInt32 ref_count;
#endif
/* This gets set to `true' when layout encounters an image with no
width or height: layout will proceed to place the image, but

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

@ -1,557 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape Public License
* Version 1.0 (the "NPL"); you may not use this file except in
* compliance with the NPL. You may obtain a copy of the NPL at
* http://www.mozilla.org/NPL/
*
* Software distributed under the NPL is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
* for the specific language governing rights and limitations under the
* NPL.
*
* The Initial Developer of this code under the NPL is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
* Reserved.
*/
#include "xp.h"
#include "xp_str.h"
#include <ctype.h>
#include <stdarg.h>
#ifdef PROFILE
#pragma profile on
#endif
#if !defined(XP_WIN) && !defined(XP_OS2) /* keep this out of the winfe */
#if defined(DEBUG)
char *
NOT_NULL (const char * p)
{
XP_ASSERT(p);
return (char*) p;
}
#endif
#endif
#define TOLOWER_TABLE_SIZE 128
PRIVATE uint8 *
xp_get_tolower_table()
{
static uint8 tolower_table[TOLOWER_TABLE_SIZE];
static XP_Bool first_time = TRUE;
if(first_time)
{
int i;
first_time = FALSE;
/* build the tolower_table */
for(i=0; i < sizeof(tolower_table); i++)
{
tolower_table[i] = (uint8) tolower((char)i);
}
}
return tolower_table;
}
PRIVATE uint8 *
xp_get_toupper_table()
{
static uint8 toupper_table[TOLOWER_TABLE_SIZE];
static XP_Bool first_time = TRUE;
if(first_time)
{
int i;
first_time = FALSE;
/* build the tolower_table */
for(i=0; i < sizeof(toupper_table); i++)
{
toupper_table[i] = (uint8) toupper((char)i);
}
}
return toupper_table;
}
#define XP_STR_TOUPPER(c) (c < TOLOWER_TABLE_SIZE ? toupper_table[c] : c)
#define XP_STR_TOLOWER(c) (c < TOLOWER_TABLE_SIZE ? tolower_table[c] : c)
/* fast table driven tolower routine
*
* We only deal with 7 bit ascii
*/
PUBLIC int
xp_tolower(int c)
{
uint8 *tolower_table = xp_get_tolower_table();
return XP_STR_TOLOWER(c);
}
/* fast table driven toupper routine
*
* We only deal with 7 bit ascii
*/
PUBLIC int
xp_toupper(int c)
{
uint8 *toupper_table = xp_get_toupper_table();
return XP_STR_TOUPPER(c);
}
/* find a substring within a string with a case insensitive search
*/
PUBLIC char *
strcasestr (const char * str, const char * substr)
{
register const char *pA;
register const char *pB;
register const char *pC;
uint8 *toupper_table = xp_get_toupper_table();
if(!str)
return(NULL);
for(pA=str; *pA; pA++)
{
if(XP_STR_TOUPPER(*pA) == XP_STR_TOUPPER(*substr))
{
for(pB=pA, pC=substr; ; pB++, pC++)
{
if(!(*pC))
return((char *)pA);
if(!(*pB))
break;
if(XP_STR_TOUPPER(*pB) != XP_STR_TOUPPER(*pC))
break;
}
}
}
return(NULL);
}
/* find a char within a specified length string
*/
PUBLIC char *
strnchr (const char * str, const char single, int32 len)
{
register int count=0;
register const char *pA;
if(!str)
return(NULL);
for(pA=str; count < len; pA++, count++)
{
if(*pA == single)
{
return((char *)pA);
}
if(!(*pA))
return(NULL);
}
return(NULL);
}
/* find a substring within a specified length string with a case
* insensitive search
*/
PUBLIC char *
strncasestr (const char * str, const char * substr, int32 len)
{
register int count=0;
register int count2=0;
register const char *pA;
register const char *pB;
register const char *pC;
uint8 *toupper_table = xp_get_toupper_table();
if(!str || !substr)
return(NULL);
for(pA=str; count < len; pA++, count++)
{
if(XP_STR_TOUPPER(*pA) == XP_STR_TOUPPER(*substr))
{
for(pB=pA, pC=substr, count2=count; count2<len;
count2++,pB++,pC++)
{
if(!(*pC))
return((char *)pA);
if(!(*pB))
break;
if(XP_TO_UPPER(*pB) != XP_TO_UPPER(*pC))
break;
}
}
}
return(NULL);
}
/* compare strings in a case insensitive manner
*/
PUBLIC int
strcasecomp (const char* one, const char *two)
{
const char *pA;
const char *pB;
uint8 *toupper_table = xp_get_toupper_table();
for(pA=one, pB=two; *pA && *pB; pA++, pB++)
{
register int tmp = XP_STR_TOUPPER(*pA) - XP_STR_TOUPPER(*pB);
if (tmp)
return tmp;
}
if (*pA)
return 1;
if (*pB)
return -1;
return 0;
}
/* compare strings in a case insensitive manner with a length limit
*/
PUBLIC int
strncasecomp (const char* one, const char * two, int n)
{
const char *pA;
const char *pB;
uint8 *toupper_table = xp_get_toupper_table();
for(pA=one, pB=two;; pA++, pB++)
{
int tmp;
if (pA == one+n)
return 0;
if (!(*pA && *pB))
return *pA - *pB;
tmp = XP_STR_TOUPPER(*pA) - XP_STR_TOUPPER(*pB);
if (tmp)
return tmp;
}
}
#ifndef MODULAR_NETLIB /* moved to nsNetStubs.cpp */
/* Allocate a new copy of a block of binary data, and returns it
*/
PUBLIC char *
NET_BACopy (char **destination, const char *source, size_t length)
{
if(*destination)
{
XP_FREE(*destination);
*destination = 0;
}
if (! source)
{
*destination = NULL;
}
else
{
*destination = (char *) XP_ALLOC (length);
if (*destination == NULL)
return(NULL);
XP_MEMCPY(*destination, source, length);
}
return *destination;
}
/* binary block Allocate and Concatenate
*
* destination_length is the length of the existing block
* source_length is the length of the block being added to the
* destination block
*/
PUBLIC char *
NET_BACat (char **destination,
size_t destination_length,
const char *source,
size_t source_length)
{
if (source)
{
if (*destination)
{
*destination = (char *) XP_REALLOC (*destination, destination_length + source_length);
if (*destination == NULL)
return(NULL);
XP_MEMMOVE (*destination + destination_length, source, source_length);
}
else
{
*destination = (char *) XP_ALLOC (source_length);
if (*destination == NULL)
return(NULL);
XP_MEMCPY(*destination, source, source_length);
}
}
return *destination;
}
/* Very similar to strdup except it free's too
*/
PUBLIC char *
NET_SACopy (char **destination, const char *source)
{
if(*destination)
{
XP_FREE(*destination);
*destination = 0;
}
if (! source)
{
*destination = NULL;
}
else
{
*destination = (char *) XP_ALLOC (XP_STRLEN(source) + 1);
if (*destination == NULL)
return(NULL);
XP_STRCPY (*destination, source);
}
return *destination;
}
/* Again like strdup but it concatinates and free's and uses Realloc
*/
PUBLIC char *
NET_SACat (char **destination, const char *source)
{
if (source && *source)
{
if (*destination)
{
int length = XP_STRLEN (*destination);
*destination = (char *) XP_REALLOC (*destination, length + XP_STRLEN(source) + 1);
if (*destination == NULL)
return(NULL);
XP_STRCPY (*destination + length, source);
}
else
{
*destination = (char *) XP_ALLOC (XP_STRLEN(source) + 1);
if (*destination == NULL)
return(NULL);
XP_STRCPY (*destination, source);
}
}
return *destination;
}
/* remove front and back white space
* modifies the original string
*/
PUBLIC char *
XP_StripLine (char *string)
{
char * ptr;
/* remove leading blanks */
while(*string=='\t' || *string==' ' || *string=='\r' || *string=='\n')
string++;
for(ptr=string; *ptr; ptr++)
; /* NULL BODY; Find end of string */
/* remove trailing blanks */
for(ptr--; ptr >= string; ptr--)
{
if(*ptr=='\t' || *ptr==' ' || *ptr=='\r' || *ptr=='\n')
*ptr = '\0';
else
break;
}
return string;
}
/************************************************************************/
char *XP_AppendStr(char *in, const char *append)
{
int alen, inlen;
alen = XP_STRLEN(append);
if (in) {
inlen = XP_STRLEN(in);
in = (char*) XP_REALLOC(in,inlen+alen+1);
if (in) {
XP_MEMCPY(in+inlen, append, alen+1);
}
} else {
in = (char*) XP_ALLOC(alen+1);
if (in) {
XP_MEMCPY(in, append, alen+1);
}
}
return in;
}
char *XP_Cat(char *a0, ...)
{
va_list ap;
char *a, *result, *cp;
int len;
/* Count up string length's */
va_start(ap, a0);
len = 1;
a = a0;
while (a != (char*) NULL) {
len += XP_STRLEN(a);
a = va_arg(ap, char*);
}
va_end(ap);
/* Allocate memory and copy strings */
va_start(ap, a0);
result = cp = (char*) XP_ALLOC(len);
if (!cp) return 0;
a = a0;
while (a != (char*) NULL) {
len = XP_STRLEN(a);
XP_MEMCPY(cp, a, len);
cp += len;
a = va_arg(ap, char*);
}
*cp = 0;
va_end(ap);
return result;
}
#endif
/************************************************************************
* These are "safe" versions of the runtime library routines. The RTL
* versions do not null-terminate dest IFF strlen(src) >= destLength.
* These versions always null-terminate, which is why they're safe.
*/
char *XP_STRNCAT_SAFE (char *dest, const char *src, size_t maxToCat)
{
int destLen;
char *result;
destLen = XP_STRLEN (dest);
result = strncat (dest, src, --maxToCat);
dest[destLen + maxToCat] = '\0';
return result;
}
char *XP_STRNCPY_SAFE (char *dest, const char *src, size_t destLength)
{
char *result = strncpy (dest, src, --destLength);
dest[destLength] = '\0';
return result;
}
/*************************************************
The following functions are used to implement
a thread safe strtok
*************************************************/
/*
* Get next token from string *stringp, where tokens are (possibly empty)
* strings separated by characters from delim. Tokens are separated
* by exactly one delimiter iff the skip parameter is false; otherwise
* they are separated by runs of characters from delim, because we
* skip over any initial `delim' characters.
*
* Writes NULs into the string at *stringp to end tokens.
* delim will usually, but need not, remain CONSTant from call to call.
* On return, *stringp points past the last NUL written (if there might
* be further tokens), or is NULL (if there are definitely no more tokens).
*
* If *stringp is NULL, strtoken returns NULL.
*/
static
char *strtoken_r(char ** stringp, const char *delim, int skip)
{
char *s;
const char *spanp;
int c, sc;
char *tok;
if ((s = *stringp) == NULL)
return (NULL);
if (skip) {
/*
* Skip (span) leading delimiters (s += strspn(s, delim)).
*/
cont:
c = *s;
for (spanp = delim; (sc = *spanp++) != 0;) {
if (c == sc) {
s++;
goto cont;
}
}
if (c == 0) { /* no token found */
*stringp = NULL;
return (NULL);
}
}
/*
* Scan token (scan for delimiters: s += strcspn(s, delim), sort of).
* Note that delim must have one NUL; we stop if we see that, too.
*/
for (tok = s;;) {
c = *s++;
spanp = delim;
do {
if ((sc = *spanp++) == c) {
if (c == 0)
s = NULL;
else
s[-1] = 0;
*stringp = s;
return( (char *) tok );
}
} while (sc != 0);
}
/* NOTREACHED */
}
char *XP_STRTOK_R(char *s1, const char *s2, char **lasts)
{
if (s1)
*lasts = s1;
return (strtoken_r(lasts, s2, 1));
}
#ifdef PROFILE
#pragma profile off
#endif

4
network/cache/mkmemcac.c поставляемый
Просмотреть файл

@ -40,11 +40,7 @@
#include "mkstream.h"
#include "extcache.h"
#include "mkmemcac.h"
#ifndef MODULAR_NETLIB
#include "libimg.h" /* Image Lib public API. */
#else
extern void IL_SetCacheSize(uint32 new_size);
#endif
#include "prclist.h"
#include "prmem.h"
#include "plstr.h"

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

@ -24,10 +24,10 @@
#include "prmem.h"
#include "nsCacheManager.h"
#include "plstr.h"
#if defined(MODULAR_NETLIB) && defined(XP_PC)
#if defined(XP_PC)
#include <direct.h>
#include "nspr.h"
#endif /* MODULAR_NETLIB */
#endif /* XP_PC */
#ifdef XP_MAC
#include "uprefd.h"
@ -128,7 +128,7 @@ nsCachePref::SetupPrefs(const char* i_Pref)
}
else //TODO set to temp folder
{
#if defined(MODULAR_NETLIB) && defined(XP_PC)
#if defined(XP_PC)
char tmpBuf[_MAX_PATH];
PRFileInfo dir;
PRStatus status;
@ -151,14 +151,8 @@ nsCachePref::SetupPrefs(const char* i_Pref)
}
}
m_DiskCacheFolder = cacheDir;
#else
m_DiskCacheFolder = new char [1];
if (!m_DiskCacheFolder)
return;
*m_DiskCacheFolder = '\0';
#endif /* MODULAR_NETLIB */
#endif /* XP_PC */
}
}
if (tempPref)

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

@ -241,17 +241,6 @@ PRIVATE int net_MultipleDocumentWrite (NET_StreamClass *stream, CONST char* s, i
format_out = CLEAR_CACHE_BIT(obj->format_out);
}
#if !defined(MODULAR_NETLIB)
/* libimg and libplugin use the fe_data to store
* urls data, so clear it only if its not them */
if( (CLEAR_CACHE_BIT(obj->format_out) != FO_INTERNAL_IMAGE)
&& (CLEAR_CACHE_BIT(obj->format_out) != FO_PLUGIN)
&& (CLEAR_CACHE_BIT(obj->format_out) != FO_BYTERANGE)
&& PL_strncasecmp(obj->URL_s->content_type, "image", 5))
{
obj->URL_s->fe_data = NULL;
}
#endif /* !MODULAR_NETLIB */
/* build a stream
*/
obj->next_stream = NET_StreamBuilder(format_out,

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

@ -30,9 +30,6 @@
* use <FONT color=> to color the different syntactical parts
* of the HTML stream
*/
#ifndef MODULAR_NETLIB
#include "pa_parse.h"
#endif
#include "xpgetstr.h"
#include "intl_csi.h"
#define VIEW_SOURCE_TARGET_WINDOW_NAME "%ViewSourceWindow"
@ -58,9 +55,6 @@ typedef struct _DataObject {
StatesEnum state;
char tag[MAXTAGLEN+1];
uint tag_index;
#ifndef MODULAR_NETLIB
int tag_type;
#endif
PRBool in_broken_html;
} DataObject;
@ -83,13 +77,6 @@ PRIVATE char *net_BeginColorHTMLTag (DataObject *obj)
{
char *new_markup = 0;
#ifndef MODULAR_NETLIB
if (obj->tag_type == P_SCRIPT)
{
StrAllocCopy(new_markup, "</XMP><PRE>");
obj->tag_type = P_UNKNOWN;
}
#endif
StrAllocCat(new_markup, BEGIN_TAG_MARKUP);
StrAllocCat(new_markup, "&lt;");
StrAllocCat(new_markup, BEGIN_TAG_NAME_MARKUP);
@ -108,17 +95,6 @@ PRIVATE char *net_EndColorHTMLTag (DataObject *obj)
}
StrAllocCat(new_markup, "&gt;");
StrAllocCat(new_markup, END_TAG_MARKUP);
#ifndef MODULAR_NETLIB
if (obj->tag_type == P_SCRIPT)
{
StrAllocCat(new_markup, "</PRE><XMP>");
obj->state = IN_SCRIPT;
}
else
{
obj->state = IN_CONTENT;
}
#endif
return new_markup;
}
@ -207,9 +183,6 @@ PRIVATE int net_ColorHTMLWrite (NET_StreamClass *stream, CONST char *s, int32 l)
StrAllocCat(new_markup, tiny_buf);
obj->state = IN_TAG;
obj->tag[obj->tag_index] = '\0';
#ifndef MODULAR_NETLIB
obj->tag_type = pa_tokenize_tag(obj->tag);
#endif
}
else if(*cp == '>')
{
@ -592,9 +565,6 @@ net_ColorHTMLStream (int format_out,
obj->state = IN_CONTENT;
obj->next_stream = next_stream;
#ifndef MODULAR_NETLIB
obj->tag_type = P_UNKNOWN;
#endif
new_stream->name = "HTML Colorer";
new_stream->complete = (MKStreamCompleteFunc) net_ColorHTMLComplete;

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

@ -102,7 +102,7 @@ AutoAdminTimeoutCallback(void *closure)
PUBLIC void
NET_DownloadAutoAdminCfgFile()
{
#ifndef MODULAR_NETLIB
#if 0 /* Used to be MODULAR_NETLIB */
static XP_Bool first_time = TRUE;
XP_Bool append_email;
char* email_addr;

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

@ -64,10 +64,6 @@
#include "xpgetstr.h"
extern int XP_EDITOR_NON_HTML;
#ifndef MODULAR_NETLIB
#include "marimurl.h"
#endif
#ifdef CRAWLER
/* crawler converters */
#include "pagescan.h"
@ -525,56 +521,6 @@ net_RegisterDefaultDecoders (void)
#endif /* XP_UNIX */
#ifndef MODULAR_NETLIB
/* Set things up so that the image library gets reconnected once the
internally-handled images have been started. */
NET_RegisterContentTypeConverter (IMAGE_GIF, FO_INTERNAL_IMAGE,
(void *) IL_GIF, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_JPG, FO_INTERNAL_IMAGE,
(void *) IL_JPEG, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_PJPG, FO_INTERNAL_IMAGE,
(void *) IL_JPEG, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_PNG, FO_INTERNAL_IMAGE,
(void *) IL_PNG, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM, FO_INTERNAL_IMAGE,
(void *) IL_XBM, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM2, FO_INTERNAL_IMAGE,
(void *) IL_XBM, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM3, FO_INTERNAL_IMAGE,
(void *) IL_XBM, IL_NewStream);
NET_RegisterContentTypeConverter ("*", FO_INTERNAL_IMAGE,
(void *) IL_UNKNOWN, IL_NewStream);
NET_RegisterContentTypeConverter (IMAGE_GIF, FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_JPG, FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_PJPG,FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_PNG, FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM, FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM2,FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM3,FO_PRESENT,NULL, IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_GIF, FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_JPG, FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_PJPG,FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_PNG,FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM, FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM2,FO_PRESENT_INLINE,NULL,
IL_ViewStream);
NET_RegisterContentTypeConverter (IMAGE_XBM3,FO_PRESENT_INLINE,NULL,
IL_ViewStream);
#endif /* !MODULAR_NETLIB */
/* register default (non)decoders for the text printer
*/
NET_RegisterContentTypeConverter ("*", FO_SAVE_AS_TEXT,
@ -793,11 +739,6 @@ NET_RegisterMIMEDecoders (void)
NET_MimeEncodingConverter);
#endif
#ifndef MODULAR_NETLIB
NET_RegisterContentTypeConverter ("*", FO_MULTIPART_IMAGE,
(void *) 1, IL_ViewStream);
#endif
#if defined(SMART_MAIL) || defined(XP_UNIX)
/* #### This should really be done all the time, because all versions of
Mozilla should be able to sensibly display documents of type

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

@ -55,7 +55,7 @@
#include "timing.h"
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
#include "progress.h"
#endif
@ -462,7 +462,7 @@ PRIVATE int net_bad_ports_table[] = {
* it again).
*
* On success hostEnt is not null. */
#if defined(XP_WIN) && defined(MODULAR_NETLIB)
#if defined(XP_WIN)
extern int NET_AsyncDNSLookup(void* aContext,
const char* aHostPort,
PRHostEnt** aHoststructPtrPtr,
@ -510,11 +510,7 @@ net_dns_lookup(MWContext *windowID,
* if it's not done yet.
*
* dbbuf and hpbuf are not needed in ASYNC_DNS case. */
#ifdef MODULAR_NETLIB
status = NET_AsyncDNSLookup(windowID, host, hostEnt, socket);
#else
status = FE_AsyncDNSLookup(windowID, host, hostEnt, socket);
#endif
if(status == MK_WAITING_FOR_LOOKUP) {
/* Always get here after first call to FE_Async.. for a
@ -755,7 +751,7 @@ net_FindAddress (const char *host_ptr,
char *msg = PR_smprintf(XP_GetString(XP_PROGRESS_LOOKUPHOST), host_port);
if(msg) {
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(window_id, NULL, msg);
#else
NET_Progress(window_id, msg);
@ -866,7 +862,7 @@ net_start_first_connect(const char *host,
{
PR_snprintf(buf, (len+10)*sizeof(char),
XP_GetString(XP_PROGRESS_CONTACTHOST), host);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(window_id, NULL, buf);
#else
NET_Progress(window_id, buf);
@ -1159,7 +1155,7 @@ HG28879
{
PR_snprintf(buf, (len+10)*sizeof(char),
XP_GetString(XP_PROGRESS_UNABLELOCATE), prefSocksHost);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(window_id, NULL, buf);
#else
NET_Progress(window_id, buf);
@ -1228,7 +1224,7 @@ HG71089
{
PR_snprintf(buf, (len+10)*sizeof(char),
XP_GetString(XP_PROGRESS_UNABLELOCATE), host);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(window_id, NULL, buf);
#else
NET_Progress(window_id, buf);
@ -1362,7 +1358,7 @@ NET_FinishConnect (CONST char *url,
{
PR_snprintf(buf, (len+10)*sizeof(char),
XP_GetString(XP_PROGRESS_UNABLELOCATE), host);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(window_id, NULL, buf);
#else
NET_Progress(window_id, buf);

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

@ -100,16 +100,7 @@
#include "jspubtd.h"
#endif
/* nglayout should render the prefered image load hack obsolete */
#ifndef MODULAR_NETLIB
#include "libimg.h" /* Image Lib public API. */
#include "il_strm.h" /* Image Lib public API. */
#endif
#include "libi18n.h"
#ifndef MODULAR_NETLIB
#include "htmldlgs.h"
#endif
#include "np.h"
#include "prefapi.h"
@ -139,11 +130,6 @@
#include "xplocale.h"
/* This is only until all platforms have libfont/ checked in */
#ifndef MODULAR_NETLIB
#define WEBFONTS
#endif
#ifdef WEBFONTS
#include "nf.h"
#endif /* WEBFONTS */
@ -151,9 +137,7 @@
/* plugins: */
#include "np.h"
#ifdef MODULAR_NETLIB
void net_ReleaseContext(MWContext *context);
#endif /* MODULAR_NETLIB */
#if defined(NETLIB_THREAD)
void net_CallExitRoutineProxy(Net_GetUrlExitFunc* exit_routine,
@ -171,7 +155,7 @@ void net_CallExitRoutineProxy(Net_GetUrlExitFunc* exit_routine,
#include "mkaccess.h" /* change to trust.h for phase 2 */
#endif
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
#include "progress.h"
#endif
@ -1243,9 +1227,7 @@ net_push_url_on_wait_queue(int url_type,
MK_OUT_OF_MEMORY,
format_out,
context);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(wus->window_id);
#endif
return(MK_OUT_OF_MEMORY);
}
@ -1340,11 +1322,7 @@ net_release_urls_for_processing(XP_Bool release_prefered, XP_Bool release_prefet
if(!release_prefered
|| ( (wus->format_out != FO_INTERNAL_IMAGE
&& wus->format_out != FO_CACHE_AND_INTERNAL_IMAGE)
#if defined(MOZILLA_CLIENT) && !defined(MODULAR_NETLIB)
|| IL_PreferredStream(wus->URL_s) ) )
#else
) )
#endif /* MOZILLA_CLIENT */
{
/* if the type passed in NOT Prefetch_priority then only
* release URL's that are NOT Prefetch_priority
@ -1492,9 +1470,7 @@ net_AbortWaitingURL(MWContext * window_id, Bool all, XP_List *list)
* funky doubly linked list stuff.
*/
XP_ListRemoveObject(list, wus);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(wus->window_id);
#endif
FREE(wus);
}
else
@ -1766,9 +1742,7 @@ NET_ShutdownNetLib(void)
tmpEntry->status,
tmpEntry->format_out,
tmpEntry->window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(tmpEntry->window_id);
#endif
PR_Free(tmpEntry); /* free the no longer active entry */
}
@ -1857,11 +1831,7 @@ PRIVATE net_number_of_proto_impls = 0;
/* registers a protocol impelementation for a particular url_type
* see NET_URL_Type() for types
*/
#ifdef MODULAR_NETLIB
PR_IMPLEMENT(void)
#else
void
#endif /* MODULAR_NETLIB */
NET_RegisterProtocolImplementation(NET_ProtoImpl *impl, int for_url_type)
{
@ -1980,9 +1950,7 @@ NET_GetURL (URL_Struct *URL_s,
MK_INTERRUPTED,
output_format,
window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_INTERRUPTED);
}
}
@ -2122,9 +2090,7 @@ NET_GetURL (URL_Struct *URL_s,
NET_TotalNumberOfProcessingURLs++;
net_CheckForWaitingURL(window_id, 0, load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_MALFORMED_URL_ERROR);
}
@ -2145,7 +2111,7 @@ NET_GetURL (URL_Struct *URL_s,
exit_routine));
}
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_StartBinding(window_id, URL_s);
#endif
@ -2281,9 +2247,7 @@ NET_GetURL (URL_Struct *URL_s,
net_CheckForWaitingURL(window_id, 0, load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_TIMEBOMB_URL_PROHIBIT);
}
}
@ -2367,9 +2331,7 @@ NET_GetURL (URL_Struct *URL_s,
window_id);
net_CheckForWaitingURL(window_id, 0, load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_INTERRUPTED);
}
}
@ -2395,9 +2357,7 @@ NET_GetURL (URL_Struct *URL_s,
output_format,
window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_OUT_OF_MEMORY);
}
@ -2417,9 +2377,7 @@ NET_GetURL (URL_Struct *URL_s,
MK_INTERRUPTED,
output_format,
window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_INTERRUPTED);
}
#endif
@ -2812,9 +2770,7 @@ NET_GetURL (URL_Struct *URL_s,
window_id);
net_CheckForWaitingURL(window_id, type, load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_OBJECT_NOT_IN_CACHE);
}
else
@ -2851,9 +2807,7 @@ NET_GetURL (URL_Struct *URL_s,
output_format,
window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
LIBNET_UNLOCK_AND_RETURN(MK_OUT_OF_MEMORY);
}
@ -2913,9 +2867,7 @@ NET_GetURL (URL_Struct *URL_s,
net_CheckForWaitingURL(window_id, this_entry->protocol,
load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
PR_Free(this_entry); /* not needed any more */
LIBNET_UNLOCK_AND_RETURN(MK_INTERRUPTED);
@ -2951,9 +2903,7 @@ NET_GetURL (URL_Struct *URL_s,
net_CheckForWaitingURL(window_id, this_entry->protocol,
load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(window_id);
#endif
PR_Free(this_entry); /* not needed any more */
LIBNET_UNLOCK_AND_RETURN(MK_INTERRUPTED);
@ -3011,16 +2961,11 @@ redo_load_switch: /* come here on file/ftp retry */
else
{
char *proxy_address = NULL;
#ifdef MODULAR_NETLIB
/* If this url struct indicates that it doesn't want to use a proxy,
* skip it. */
if (!this_entry->URL_s->bypassProxy) {
proxy_address = NET_FindProxyHostForUrl(type, this_entry->URL_s->address);
}
#else
proxy_address = NET_FindProxyHostForUrl(type, this_entry->URL_s->address);
#endif /* MODULAR_NETLIB */
if(proxy_address)
{
this_entry->protocol = HTTP_TYPE_URL;
@ -3155,9 +3100,7 @@ redo_load_switch: /* come here on file/ftp retry */
this_entry->protocol,
load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(this_entry->window_id);
#endif
PR_Free(this_entry);
LIBNET_UNLOCK_AND_RETURN(MK_OFFLINE);
}
@ -3180,9 +3123,7 @@ redo_load_switch: /* come here on file/ftp retry */
net_CheckForWaitingURL(this_entry->window_id,
this_entry->protocol,
load_background);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(this_entry->window_id);
#endif
PR_Free(this_entry); /* not needed any more */
}
@ -3514,9 +3455,7 @@ PUBLIC int NET_ProcessNet (PRFileDesc *ready_fd, int fd_type) {
}
#endif /* MILAN */
#if defined(MODULAR_NETLIB)
net_ReleaseContext(tmpEntry->window_id);
#endif
} /* end status variable if statements */
PR_Free(tmpEntry); /* free the now non active entry */
@ -3586,9 +3525,7 @@ net_InterruptActiveStream (ActiveEntry *entry, Bool show_warning)
FE_AllConnectionsComplete(entry->window_id);
/* free the no longer active entry */
#if defined(MODULAR_NETLIB)
net_ReleaseContext(entry->window_id);
#endif
PR_Free(entry);
return 0;
@ -3720,7 +3657,7 @@ NET_SetNewContext(URL_Struct *URL_s, MWContext * new_context, Net_GetUrlExitFunc
{
if (tmpEntry->URL_s == URL_s)
{
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
/* When the URL load gets redirected to another window,
we need to notify the progress manager from the old
window that the URL need no longer be tracked */
@ -3742,7 +3679,7 @@ NET_SetNewContext(URL_Struct *URL_s, MWContext * new_context, Net_GetUrlExitFunc
old_window_id = tmpEntry->window_id;
tmpEntry->window_id = new_context;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
/* Inform the progress manager in the new context about
the URL that it just received */
PM_StartBinding(tmpEntry->window_id, URL_s);
@ -3765,9 +3702,7 @@ NET_SetNewContext(URL_Struct *URL_s, MWContext * new_context, Net_GetUrlExitFunc
if(!NET_AreThereActiveConnectionsForWindow(old_window_id))
FE_AllConnectionsComplete(old_window_id);
#if defined(MODULAR_NETLIB)
net_ReleaseContext(old_window_id);
#endif
LIBNET_UNLOCK();
return(0);
}
@ -4565,7 +4500,7 @@ net_HTMLPanelLoad(ActiveEntry *ce)
{
if(ce->URL_s)
StrAllocCopy(ce->URL_s->charset, INTL_ResourceCharSet());
#ifndef MODULAR_NETLIB
#if 0 /* Used to be MODULAR_NETLIB */
XP_HandleHTMLPanel(ce->URL_s);
#endif
return -1;
@ -4576,7 +4511,7 @@ net_HTMLDialogLoad(ActiveEntry *ce)
{
if(ce->URL_s)
StrAllocCopy(ce->URL_s->charset, INTL_ResourceCharSet());
#ifndef MODULAR_NETLIB
#if 0 /* Used to be MODULAR_NETLIB */
XP_HandleHTMLDialog(ce->URL_s);
#endif
return -1;

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

@ -138,11 +138,7 @@ extern char * NET_FindProxyHostForUrl(int urltype, char *urladdress);
/* registers a protocol impelementation for a particular url_type
* see NET_URL_Type() for types
*/
#ifdef MODULAR_NETLIB
PR_EXTERN(void)
#else
extern void
#endif /* MODULAR_NETLIB */
NET_RegisterProtocolImplementation(NET_ProtoImpl *impl, int for_url_type);

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

@ -132,11 +132,7 @@ NET_HaveConverterForMimeType(char *content_type)
/* Find a converter routine to create a stream and return the stream struct
*/
#ifdef MODULAR_NETLIB
PR_IMPLEMENT(NET_StreamClass *)
#else
NET_StreamClass *
#endif /* MODULAR_NETLIB */
NET_StreamBuilder (FO_Present_Types format_out,
URL_Struct *URL_s,
MWContext *context)

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

@ -872,11 +872,7 @@ HG29784
}
/* Separate the headers from the data with a CR and LF. */
#if defined(MODULAR_NETLIB)
if(URL_s->post_headers && !data_obj->CRSent) {
#else
if(!data_obj->CRSent) {
#endif
data_obj->buffer[0] = CR;
data_obj->buffer[1] = LF;
data_obj->buffer[2] = '\0';
@ -899,11 +895,7 @@ HG29784
data_obj->LFSent = TRUE;
}
#if defined(MODULAR_NETLIB)
if(URL_s->post_headers && !data_obj->LFSent) {
#else
if(!data_obj->LFSent) {
#endif
data_obj->buffer[0] = LF;
data_obj->buffer[1] = '\0';
amtWritten = PR_Write(sock, data_obj->buffer, PL_strlen(data_obj->buffer));

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

@ -25,7 +25,7 @@
/* The puropse of this file is simply to add a level of abstraction between netlib
* and the XP_File* api. */
#if defined(MODULAR_NETLIB) && defined(NS_NET_FILE)
#if defined(NS_NET_FILE)
extern int NET_I_XP_Stat(const char * name, XP_StatStruct * outStat, XP_FileType type);
#define NET_XP_Stat(name, out, type) NET_I_XP_Stat(name, out, type)
@ -88,6 +88,6 @@ extern int NET_I_XP_FileRemove(const char * name, XP_FileType type);
#define NET_XP_FileClose(fp) XP_FileClose(fp)
#define NET_XP_FileRemove(name, type) XP_FileRemove(name, type)
#endif /* MODULAR_NETLIB */
#endif /* NS_NET_FILE */
#endif /* _net_xp_file_h */

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

@ -29,15 +29,9 @@
#include "netutils.h"
#include "net_xp_file.h"
#ifdef MODULAR_NETLIB
static char *net_default_types [] = {
# include "ngtypes.h"
0 };
#else
static char *net_default_types [] = {
# include "mktypes.h"
0 };
#endif
/* func proto
*/

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

@ -72,8 +72,10 @@ nsHttpURLFactory::CreateURL(nsIURL* *aResult,
return NS_ERROR_OUT_OF_MEMORY;
NS_ADDREF(url);
nsresult err = url->ParseURL(aSpec, aContextURL);
if (err != NS_OK)
if (err != NS_OK) {
NS_RELEASE(url);
return err;
}
*aResult = url;
return NS_OK;
}

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

@ -287,9 +287,8 @@ net_OutputURLDocInfo(MWContext *ctxt, char *which, char **data, int32 *length)
&& !PL_strncasecmp(URL_s->content_type, "image", 5))
{
/* Have a seat. Lie down. Tell me about yourself. */
#ifdef MODULAR_NETLIB
il_msg = NULL;
#else
#if 0 /* Used to be MODULAR_NETLIB */
il_msg = IL_HTMLImageInfo(URL_s->address);
#endif
if (il_msg) {

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

@ -43,13 +43,9 @@
#include "glhist.h"
#include "il_strm.h" /* Image Lib stream converters. */
#ifndef MODULAR_NETLIB
#include "libimg.h" /* Image Lib public API. */
#else
#include "il_types.h"
IL_EXTERN(int)
IL_Type(const char *buf, int32 len);
#endif
#if defined(XP_WIN) || defined(XP_OS2)
#include "errno.h"
@ -61,7 +57,7 @@ IL_Type(const char *buf, int32 len);
extern void ProcessCookiesAndTrustLabels( ActiveEntry *ce );
#endif
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
#include "progress.h"
#endif
@ -506,7 +502,7 @@ net_open_file (ActiveEntry * cur_entry)
return(MK_UNABLE_TO_OPEN_FILE);
}
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_PROGRESS_READFILE));
@ -530,7 +526,7 @@ net_open_file (ActiveEntry * cur_entry)
con_data->next_state = NET_SETUP_FILE_STREAM;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(cur_entry->window_id,
cur_entry->URL_s,
0,
@ -574,7 +570,7 @@ net_setup_file_stream (ActiveEntry * cur_entry)
if(!count)
{
NET_ClearFileReadSelect(CE_WINDOW_ID, NET_XP_Fileno(con_data->file_ptr));
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_PROGRESS_FILEZEROLENGTH));
@ -846,7 +842,7 @@ net_open_directory (ActiveEntry * cur_entry)
con_data->is_dir = TRUE;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(cur_entry->window_id,
cur_entry->URL_s,
0,
@ -905,7 +901,7 @@ net_read_file_chunk(ActiveEntry * cur_entry)
cur_entry->save_stream = con_data->stream;
con_data->stream = NULL;
NET_ClearFileReadSelect(CE_WINDOW_ID, NET_XP_Fileno(con_data->file_ptr));
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_PROGRESS_FILEDONE));
@ -924,7 +920,7 @@ net_read_file_chunk(ActiveEntry * cur_entry)
/* go get more byte ranges */
COMPLETE_STREAM;
con_data->next_state = NET_SETUP_FILE_STREAM;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_READING_SEGMENT));
@ -936,7 +932,7 @@ net_read_file_chunk(ActiveEntry * cur_entry)
}
NET_ClearFileReadSelect(CE_WINDOW_ID, NET_XP_Fileno(con_data->file_ptr));
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_PROGRESS_FILEDONE));
@ -955,7 +951,7 @@ net_read_file_chunk(ActiveEntry * cur_entry)
CE_STATUS = PUTB(NET_Socket_Buffer, count);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(cur_entry->window_id,
cur_entry->URL_s,
cur_entry->bytes_received,
@ -1049,7 +1045,7 @@ net_read_directory_chunk (ActiveEntry * cur_entry)
PR_FREEIF(full_path);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(cur_entry->window_id,
cur_entry->URL_s,
XP_GetString(XP_PROGRESS_DIRDONE));
@ -1358,7 +1354,7 @@ net_ProcessFile (ActiveEntry * cur_entry)
case NET_FILE_DONE:
if(con_data->stream)
COMPLETE_STREAM;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_StopBinding(cur_entry->window_id, cur_entry->URL_s, 0, NULL);
#endif
con_data->next_state = NET_FILE_FREE;
@ -1378,7 +1374,7 @@ net_ProcessFile (ActiveEntry * cur_entry)
NET_ClearFileReadSelect(CE_WINDOW_ID, NET_XP_Fileno(con_data->file_ptr));
NET_XP_FileClose(con_data->file_ptr);
}
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_StopBinding(cur_entry->window_id, cur_entry->URL_s, -1, NULL);
#endif
con_data->next_state = NET_FILE_FREE;
@ -1391,7 +1387,7 @@ net_ProcessFile (ActiveEntry * cur_entry)
con_data->calling_netlib_all_the_time = FALSE;
}
#if !defined(SMOOTH_PROGRESS) || defined(MODULAR_NETLIB)
#if !defined(SMOOTH_PROGRESS)
if(CD_DESTROY_GRAPH_PROGRESS)
FE_GraphProgressDestroy(CE_WINDOW_ID,
cur_entry->URL_s,
@ -1535,11 +1531,8 @@ PRIVATE void net_IdxConvComplete(NET_StreamClass *inputStream)
PD_PUTS(out_buf);
}
}
#ifndef MODULAR_NETLIB
PR_snprintf(out_buf, sizeof(out_buf), "<PRE>"CRLF);
PD_PUTS(out_buf); /* output the line */
#endif
if(NET_HTTPIndexParserGetTextMessage(obj->parse_data))
if(NET_HTTPIndexParserGetTextMessage(obj->parse_data))
{
char *msg;
@ -1622,11 +1615,7 @@ PRIVATE void net_IdxConvComplete(NET_StreamClass *inputStream)
PR_snprintf(out_buf,
sizeof(out_buf),
"<IMG ALIGN=absbottom "
#ifndef MODULAR_NETLIB
"BORDER=0 SRC=\"internal-gopher-menu\">");
#else
"BORDER=0 SRC=\"resource:/res/network/gopher-menu.gif\">");
#endif
}
else if(cinfo && cinfo->icon)
{
@ -1639,11 +1628,7 @@ PRIVATE void net_IdxConvComplete(NET_StreamClass *inputStream)
PR_snprintf(out_buf,
sizeof(out_buf),
"<IMG ALIGN=absbottom BORDER=0 "
#ifndef MODULAR_NETLIB
"SRC=\"internal-gopher-unknown\">");
#else
"SRC=\"resource:/res/network/gopher-unknown.gif\">");
#endif
}
PD_PUTS(out_buf); /* output the line */
@ -1740,9 +1725,7 @@ PRIVATE void net_IdxConvComplete(NET_StreamClass *inputStream)
cleanup:
NET_HTTPIndexParserFree(obj->parse_data);
PR_FREEIF(path);
#ifdef MODULAR_NETLIB
(stream->complete)(stream);
#endif
}
PRIVATE void net_IdxConvAbort(NET_StreamClass *stream, int32 status)

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

@ -56,7 +56,7 @@
#include "pwcacapi.h"
#include "secnav.h"
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
#include "progress.h"
#endif
@ -1395,7 +1395,7 @@ net_send_port(ActiveEntry * ce)
opt.value.non_blocking = PR_TRUE;
sock_status = PR_SetSocketOption(cd->listen_sock, &opt);
if (sock_status != PR_SUCCESS)
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s,
XP_GetString(XP_ERROR_COULD_NOT_MAKE_CONNECTION_NON_BLOCKING));
#else
@ -1531,7 +1531,7 @@ net_get_ftp_file_type(ActiveEntry *ce)
/* start the graph progress now since we know the size
*/
ce->URL_s->content_length = cd->total_size_of_files_to_post;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, 0, ce->URL_s->content_length);
#else
FE_GraphProgressInit(ce->window_id, ce->URL_s, ce->URL_s->content_length);
@ -2175,7 +2175,7 @@ net_begin_put_response(ActiveEntry * ce)
XP_GetString( XP_POSTING_FILE ),
cd->file_to_post);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, cd->output_buffer);
#else
NET_Progress(ce->window_id, cd->output_buffer);
@ -2262,7 +2262,7 @@ net_do_put(ActiveEntry * ce)
PR_Close(cd->dsock);
cd->dsock = NULL;
#if !defined(SMOOTH_PROGRESS) || defined(MODULAR_NETLIB)
#if !defined(SMOOTH_PROGRESS)
if(cd->destroy_graph_progress)
{
FE_GraphProgressDestroy(ce->window_id,
@ -2337,7 +2337,7 @@ net_do_put(ActiveEntry * ce)
else if(ce->status > 0)
{
ce->bytes_received += ce->status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, ce->bytes_received, ce->URL_s->content_length);
#else
FE_GraphProgress(ce->window_id,
@ -2579,7 +2579,7 @@ HG69136
/* start the graph progress indicator
*/
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, 0, ce->URL_s->real_content_length);
#else
FE_GraphProgressInit(ce->window_id, ce->URL_s, ce->URL_s->real_content_length);
@ -2669,7 +2669,7 @@ net_ftp_push_partial_cache_file(ActiveEntry * ce)
{
/* All done, switch over to incoming data */
TRACEMSG(("Closing FTP cache file"));
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_FILEDONE));
#else
NET_Progress(ce->window_id, XP_GetString(XP_PROGRESS_FILEDONE));
@ -2681,7 +2681,7 @@ net_ftp_push_partial_cache_file(ActiveEntry * ce)
NET_SetReadSelect(ce->window_id, ce->socket);
ce->local_file = FALSE;
cd->next_state = FTP_READ_FILE;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_RECEIVE_FTPFILE));
#else
NET_Progress (ce->window_id, XP_GetString(XP_PROGRESS_RECEIVE_FTPFILE));
@ -2693,7 +2693,7 @@ net_ftp_push_partial_cache_file(ActiveEntry * ce)
/* write the data */
TRACEMSG(("Transferring %ld bytes from cache file.", status));
ce->bytes_received += status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, ce->bytes_received, ce->URL_s->real_content_length);
#else
FE_GraphProgress(ce->window_id, ce->URL_s, ce->bytes_received, status, ce->URL_s->real_content_length);
@ -2730,7 +2730,7 @@ net_start_ftp_read_file(ActiveEntry * ce)
ce->local_file = TRUE;
cd->next_state = FTP_READ_CACHE;
cd->partial_cache_fp = fp;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_READFILE));
#else
NET_Progress(ce->window_id, XP_GetString(XP_PROGRESS_READFILE));
@ -2746,7 +2746,7 @@ net_start_ftp_read_file(ActiveEntry * ce)
ce->socket = cd->dsock;
NET_SetReadSelect(ce->window_id, ce->socket);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_RECEIVE_FTPFILE));
#else
NET_Progress (ce->window_id, XP_GetString(XP_PROGRESS_RECEIVE_FTPFILE));
@ -2785,7 +2785,7 @@ net_ftp_read_file(ActiveEntry * ce)
if(status > 0)
{
ce->bytes_received += status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, ce->bytes_received, ce->URL_s->real_content_length);
#else
FE_GraphProgress(ce->window_id, ce->URL_s, ce->bytes_received, status, ce->URL_s->real_content_length);
@ -2851,7 +2851,7 @@ net_start_ftp_read_dir(ActiveEntry * ce)
cd->sort_base = NET_SortInit();
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_RECEIVE_FTPDIR));
#else
NET_Progress (ce->window_id, XP_GetString(XP_PROGRESS_RECEIVE_FTPDIR));
@ -2985,7 +2985,7 @@ net_ftp_read_dir(ActiveEntry * ce)
if(ce->status > 1)
{
ce->bytes_received += ce->status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id, ce->URL_s, ce->bytes_received, ce->URL_s->content_length);
#else
FE_GraphProgress(ce->window_id, ce->URL_s, ce->bytes_received, ce->status, ce->URL_s->content_length);
@ -4700,7 +4700,7 @@ net_ProcessFTP(ActiveEntry * ce)
cd->calling_netlib_all_the_time = FALSE;
}
#if !defined(SMOOTH_PROGRESS) || defined(MODULAR_NETLIB)
#if !defined(SMOOTH_PROGRESS)
if(cd->destroy_graph_progress)
FE_GraphProgressDestroy(ce->window_id,
ce->URL_s,

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

@ -2352,12 +2352,8 @@ net_IntSetCookieString(MWContext * context,
* since it might do file I/O and uses the preferences
* global context + objects.
*/
#if !defined(MODULAR_NETLIB)
result= (JSCFResult)ET_JSCFExecute(context, script_name, cd, &changed);
#else
/* XXX: This is probably not correct, but it will fix the build for now... */
result= JSCF_Execute(context, script_name, cd, &changed);
#endif /* MODULAR_NETLIB */
if( result != JSCF_error) {
if( changed ) {
if( cd->path_from_header != path_from_header ) {

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

@ -61,7 +61,7 @@
#include "xp_error.h"
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
#include "progress.h"
#endif
@ -907,7 +907,7 @@ net_begin_upload_file (ActiveEntry *ce)
status_msg = PR_smprintf("Uploading file %s", filename);
if(status_msg)
{
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, status_msg);
#else
NET_Progress(ce->window_id, status_msg);
@ -1684,7 +1684,7 @@ net_send_http_request (ActiveEntry *ce)
char* msg = PR_smprintf(XP_GetString(XP_PROGRESS_WAIT_REPLY),
nonProxyHost);
if (msg) {
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, msg);
#else
NET_Progress(ce->window_id, msg);
@ -1763,7 +1763,7 @@ net_http_send_post_data (ActiveEntry *ce)
char* msg = PR_smprintf(XP_GetString(XP_PROGRESS_WAIT_REPLY),
nonProxyHost);
if (msg) {
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, msg);
#else
NET_Progress(ce->window_id, msg);
@ -1780,7 +1780,7 @@ net_http_send_post_data (ActiveEntry *ce)
else if(cd->total_size_of_files_to_post && ce->status > 0)
{
cd->total_amt_written += ce->status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id,
ce->URL_s,
cd->total_amt_written,
@ -2489,7 +2489,7 @@ net_setup_http_stream(ActiveEntry * ce) {
int status;
NET_ClearReadSelect(ce->window_id, cd->connection->sock);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Suspend(ce->window_id, ce->URL_s);
#endif
@ -2499,7 +2499,7 @@ net_setup_http_stream(ActiveEntry * ce) {
ce->URL_s->protection_template,
cd->sent_authorization);
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Resume(ce->window_id, ce->URL_s);
#endif
@ -2550,7 +2550,7 @@ net_setup_http_stream(ActiveEntry * ce) {
else
proxyServer = cd->proxy_server;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Suspend(ce->window_id, ce->URL_s);
#endif
@ -2562,7 +2562,7 @@ net_setup_http_stream(ActiveEntry * ce) {
else
ce->URL_s->dont_cache = TRUE;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Resume(ce->window_id, ce->URL_s);
#endif
@ -2840,7 +2840,7 @@ net_setup_http_stream(ActiveEntry * ce) {
cd->use_copy_from_cache = FALSE;
} else {
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id,
ce->URL_s,
0,
@ -2868,7 +2868,7 @@ net_setup_http_stream(ActiveEntry * ce) {
char* msg = PR_smprintf(XP_GetString(XP_PROGRESS_TRANSFER_DATA),
nonProxyHost);
if (msg) {
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, msg);
#else
NET_Progress(ce->window_id, msg);
@ -2888,7 +2888,7 @@ net_setup_http_stream(ActiveEntry * ce) {
(*cd->stream->is_write_ready)(cd->stream);
ce->status = PUTBLOCK(cd->line_buffer, cd->line_buffer_size);
ce->bytes_received = cd->line_buffer_size;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id,
ce->URL_s,
ce->bytes_received,
@ -3081,7 +3081,7 @@ net_pull_http_data(ActiveEntry * ce)
if(ce->status > 0)
{
ce->bytes_received += ce->status;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id,
ce->URL_s,
ce->bytes_received,
@ -3241,7 +3241,7 @@ net_HTTPLoad (ActiveEntry * ce)
xpFileToPost))
cd->total_size_of_files_to_post += stat_entry.st_size;
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Progress(ce->window_id,
ce->URL_s,
0,
@ -3525,7 +3525,7 @@ HG51096
cd->stream = 0;
}
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
/* XXX what to do if redirected to cache? */
PM_StopBinding(ce->window_id, ce->URL_s, 0, NULL);
#endif
@ -3603,7 +3603,7 @@ HG51096
PR_Free(cd->connection);
}
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_StopBinding(ce->window_id, ce->URL_s, -1, NULL);
#endif
@ -3634,7 +3634,7 @@ HG51096
ce->URL_s->post_data_is_file = FALSE;
}
#if !defined(SMOOTH_PROGRESS) || defined(MODULAR_NETLIB)
#if !defined(SMOOTH_PROGRESS)
if(cd->destroy_graph_progress)
FE_GraphProgressDestroy(ce->window_id,
ce->URL_s,
@ -3679,7 +3679,7 @@ HG51096
&& !cd->posting) {
/* Could be a HTTP 0/1 compability problem. */
TRACEMSG(("HTTP: Read error trying again with HTTP0 request."));
#if defined(SMOOTH_PROGRESS) && !defined(MODULAR_NETLIB)
#if defined(SMOOTH_PROGRESS)
PM_Status(ce->window_id, ce->URL_s, XP_GetString(XP_PROGRESS_TRYAGAIN));
#else
NET_Progress (ce->window_id, XP_GetString(XP_PROGRESS_TRYAGAIN));