From 8304001d6053430f393c9adb95e7dfb31eb4d56d Mon Sep 17 00:00:00 2001 From: "valeski%netscape.com" Date: Wed, 16 Sep 1998 00:35:32 +0000 Subject: [PATCH] ? network/module/nsILoadAttribs.h New nsIloadAttribs interface that defines the load attributes that are will be associated with a url. ? network/module/nsLoadAttribs.cpp New nsIloadAttribs interface implementation. M network/main/mkconect.c Check for a new local ip address to use. If found PR_Bind() is called to bind the connecting socket to the new address. M network/main/mkgeturl.c Added logic to determine whether or not skip the proxy for the given url. M network/main/mktcp.h api change. Changed NET_BeginConnect() and NET_FinishConnect() function prototypes. M network/module/MANIFEST Added nsILoadAttribs.h to exports list M network/module/Makefile Added nsILoadAttribs.h to exports list and nsILoadAttribs.cpp to compile lists. M network/module/makefile.win Added nsILoadAttribs.h to exports list and nsILoadAttribs.cpp to compile lists. M network/module/nsIURL.h Added accessor methods to the url interface for nsILoadAttribs interface pointer. M network/module/nsNetService.h Added urlSetup method to class definition. M network/module/nsNetService.cpp Condensed url setup (from nsIURL properties to the actual url struct) into a helper routine. URL struct setup now transfers nsILoadAttributes over into the url struct. M network/module/nsURL.cpp Added nsILoadAttribs accessor method implementations to the url implementation. M network/protocol/ftp/mkftp.c api change. NET_*Connect(). M network/protocol/gopher/mkgopher.c api change. NET_*Connect(). M network/protocol/http/mkhttp.c api change. NET_*Connect(). M network/protocol/imap4/mkimap4.cpp api change. NET_*Connect(). M network/protocol/nntp/mknews.c api change. NET_*Connect(). M network/protocol/pop3/mkpop3.c api change. NET_*Connect(). M network/protocol/smtp/mksmtp.c api change. NET_*Connect(). git-svn-id: svn://10.0.0.236/trunk@10102 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/network/main/mkconect.c | 54 +++++++++++-- mozilla/network/main/mkgeturl.c | 13 ++- mozilla/network/main/mktcp.h | 6 +- mozilla/network/module/MANIFEST | 1 + mozilla/network/module/Makefile | 4 +- mozilla/network/module/makefile.win | 2 + mozilla/network/module/nsILoadAttribs.h | 29 +++++++ mozilla/network/module/nsIURL.h | 6 ++ mozilla/network/module/nsLoadAttribs.cpp | 92 ++++++++++++++++++++++ mozilla/network/module/nsNetService.cpp | 68 ++++++++++------ mozilla/network/module/nsNetService.h | 2 + mozilla/network/module/nsURL.cpp | 20 +++++ mozilla/network/protocol/ftp/mkftp.c | 12 ++- mozilla/network/protocol/gopher/mkgopher.c | 6 +- mozilla/network/protocol/http/mkhttp.c | 12 ++- mozilla/network/protocol/imap4/mkimap4.cpp | 6 +- mozilla/network/protocol/nntp/mknews.c | 6 +- mozilla/network/protocol/pop3/mkpop3.c | 6 +- mozilla/network/protocol/smtp/mksmtp.c | 6 +- 19 files changed, 298 insertions(+), 53 deletions(-) create mode 100644 mozilla/network/module/nsILoadAttribs.h create mode 100644 mozilla/network/module/nsLoadAttribs.cpp diff --git a/mozilla/network/main/mkconect.c b/mozilla/network/main/mkconect.c index da7a19d9e35..763b78c0253 100644 --- a/mozilla/network/main/mkconect.c +++ b/mozilla/network/main/mkconect.c @@ -892,7 +892,8 @@ net_start_first_connect(const char *host, PRFileDesc *sock, MWContext *window_id, TCP_ConData *tcp_con_data, - char **error_msg) + char **error_msg, + PRUint32 localIP) { /* malloc the string to prevent overflow @@ -919,6 +920,25 @@ net_start_first_connect(const char *host, tcp_con_data->begin_time = time(NULL); #define CONNECT_TIMEOUT 0 + + /* Bind to a user specified local IP address if specified. + * Netlib does not check the validity of this address. + * The user is guaranteing it's existence and usability. */ + if ( localIP > 0 ) { + PRStatus status; + PRNetAddr *addr = (PRNetAddr *)PR_Malloc(sizeof(PRNetAddr)); + PRErrorCode errorCode; /* see http://www.mozilla.org/docs/refList/refNSPR/prerr.htm#1027954 */ + status = PR_InitializeNetAddr(PR_IpAddrNull, 0, addr); + if (status != PR_SUCCESS) { + errorCode = PR_GetError(); + } else { + addr->inet.ip = localIP; + status = PR_Bind(sock, addr); + if (status != PR_SUCCESS) { + errorCode = PR_GetError(); + } + } + } /* if it's not equal to PR_SUCCESS something went wrong * @@ -1050,7 +1070,8 @@ NET_BeginConnect (CONST char *url, MWContext *window_id, char **error_msg, u_long socks_host, - short socks_port) + short socks_port, + PRUint32 localIP) { char * proxy=NULL; @@ -1263,7 +1284,7 @@ HG71089 TIMING_STARTCLOCK_NAME("tcp:connect", url); status = net_start_first_connect(host, *sock, window_id, - *tcp_con_data, error_msg); + *tcp_con_data, error_msg, localIP); if(status != MK_WAITING_FOR_CONNECTION) { @@ -1308,7 +1329,8 @@ NET_FinishConnect (CONST char *url, PRFileDesc **sock, TCP_ConData **tcp_con_data, MWContext *window_id, - char **error_msg) + char **error_msg, + PRUint32 localIP) { int status; char *host=NULL; @@ -1382,7 +1404,7 @@ NET_FinishConnect (CONST char *url, TIMING_STARTCLOCK_NAME("tcp:connect", url); status = net_start_first_connect(host, *sock, window_id, - *tcp_con_data, error_msg); + *tcp_con_data, error_msg, localIP); if(status != MK_WAITING_FOR_CONNECTION) { @@ -1427,6 +1449,25 @@ NET_FinishConnect (CONST char *url, } #if defined(XP_WIN16) + /* Bind to a user specified local IP address if specified. + * Netlib does not check the validity of this address. + * The user is guaranteing it's existence and usability. */ + if ( localIP > 0 ) { + PRStatus status; + PRNetAddr *addr = (PRNetAddr *)PR_Malloc(sizeof(PRNetAddr)); + PRErrorCode errorCode; /* see http://www.mozilla.org/docs/refList/refNSPR/prerr.htm#1027954 */ + status = PR_InitializeNetAddr(PR_IpAddrNull, 0, addr); + if (status != PR_SUCCESS) { + errorCode = PR_GetError(); + } else { + addr->inet.ip = localIP; + status = PR_Bind(sock, addr); + if (status != PR_SUCCESS) { + errorCode = PR_GetError(); + } + } + } + if(PR_SUCCESS != PR_Connect (*sock, &(*tcp_con_data)->net_addr, CONNECT_TIMEOUT)) @@ -1512,7 +1553,8 @@ error_out: window_id, error_msg, 0, - 0)); + 0, + localIP)); /* else fall through to the error */ } else diff --git a/mozilla/network/main/mkgeturl.c b/mozilla/network/main/mkgeturl.c index 723602ff781..f5d1f7117ec 100644 --- a/mozilla/network/main/mkgeturl.c +++ b/mozilla/network/main/mkgeturl.c @@ -2973,8 +2973,17 @@ redo_load_switch: /* come here on file/ftp retry */ } else { - char *proxy_address = NET_FindProxyHostForUrl(type, this_entry->URL_s->address); - + 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; diff --git a/mozilla/network/main/mktcp.h b/mozilla/network/main/mktcp.h index 2153222ef07..3ee9bcad216 100644 --- a/mozilla/network/main/mktcp.h +++ b/mozilla/network/main/mktcp.h @@ -102,7 +102,8 @@ NET_BeginConnect (CONST char *url, MWContext *window_id, char **error_msg, u_long socks_host, - short socks_port); + short socks_port, + PRUint32 localIP); /* @@ -122,7 +123,8 @@ NET_FinishConnect (CONST char *url, PRFileDesc **s, TCP_ConData **tcp_con_data, MWContext *window_id, - char **error_msg); + char **error_msg, + PRUint32 localIP); /* * Echo to stderr as well as the socket diff --git a/mozilla/network/module/MANIFEST b/mozilla/network/module/MANIFEST index bf529dc0fbb..42a45f629d8 100644 --- a/mozilla/network/module/MANIFEST +++ b/mozilla/network/module/MANIFEST @@ -12,3 +12,4 @@ nsIHttpUrl.h nsINetContainerApplication.h nsIRefreshUrl.h nsIConnectionInfo.h +nsILoadAttribs.h diff --git a/mozilla/network/module/Makefile b/mozilla/network/module/Makefile index 595e07e3cc7..0201817b528 100644 --- a/mozilla/network/module/Makefile +++ b/mozilla/network/module/Makefile @@ -29,6 +29,7 @@ CPPSRCS = \ nsStubContext.cpp \ nsNetStubs.cpp \ nsNetIDs.cpp \ + nsLoadAttribs.cpp \ $(NULL) REQUIRES = raptor js dbm nspr security pref xpcom util img \ @@ -44,7 +45,8 @@ EXPORTS = nsIStreamListener.h \ nsIHttpUrl.h \ nsINetContainerApplication.h \ nsIRefreshUrl.h \ - nsIConnectionInfo.h \ + nsIConnectionInfo.h \ + nsILoadAttribs.h \ $(NULL) include $(DEPTH)/config/config.mk diff --git a/mozilla/network/module/makefile.win b/mozilla/network/module/makefile.win index 29cecfc3bbd..823400f6e58 100644 --- a/mozilla/network/module/makefile.win +++ b/mozilla/network/module/makefile.win @@ -33,6 +33,7 @@ EXPORTS = nsIStreamListener.h \ nsIRefreshUrl.h \ nsIConnectionInfo.h \ nsINetFile.h \ + nsILoadAttribs.h \ $(NULL) DIRS = tests @@ -70,6 +71,7 @@ OBJS= \ .\$(OBJDIR)\nsNetStubs.obj \ .\$(OBJDIR)\nsNetIDs.obj \ .\$(OBJDIR)\nsNetFile.obj \ + .\$(OBJDIR)\nsLoadAttribs.obj \ $(NULL) #//------------------------------------------------------------------------ diff --git a/mozilla/network/module/nsILoadAttribs.h b/mozilla/network/module/nsILoadAttribs.h new file mode 100644 index 00000000000..41793733c96 --- /dev/null +++ b/mozilla/network/module/nsILoadAttribs.h @@ -0,0 +1,29 @@ +#include "nscore.h" +#include "prtypes.h" +#include "nsISupports.h" + +#ifndef nsILoadAttribs_h___ +#define nsILoadAttribs_h___ + +// Class ID for an implementation of nsILoadAttribs +// {8942D321-48D3-11d2-9E7A-006008BF092E} +#define NS_ILOAD_ATTRIBS_IDD \ + { 0x8942d321, 0x48d3, 0x11d2,{0x9e, 0x7a, 0x00, 0x60, 0x08, 0xbf, 0x09, 0x2e}} + +// Defining attributes of a url's load behavior. +class nsILoadAttribs : public nsISupports { +public: + // Bypass Proxy. + NS_IMETHOD SetBypassProxy(PRBool aBypass) = 0; + NS_IMETHOD GetBypassProxy(PRBool *aBypass) = 0; + + // Local IP address. + NS_IMETHOD SetLocalIP(const PRUint32 aLocalIP) = 0; + NS_IMETHOD GetLocalIP(PRUint32 *aLocalIP) = 0; +}; + +/* Creation routines. */ + +extern NS_NET nsresult NS_NewLoadAttribs(nsILoadAttribs** aInstancePtrResult); + +#endif // nsILoadAttribs_h___ diff --git a/mozilla/network/module/nsIURL.h b/mozilla/network/module/nsIURL.h index e8520fb7e2a..f210b4dddce 100644 --- a/mozilla/network/module/nsIURL.h +++ b/mozilla/network/module/nsIURL.h @@ -20,6 +20,7 @@ #include "nscore.h" #include "nsISupports.h" +#include "nsILoadAttribs.h" class nsIInputStream; class nsIStreamListener; @@ -49,6 +50,8 @@ public: virtual nsresult SetReloadType(const PRInt32 type) = 0; + virtual nsresult SetLoadAttribs(nsILoadAttribs *aLoadAttrib) = 0; + /** Accessors */ //@{ /** @@ -78,6 +81,9 @@ public: /** @return the reload type for this url */ virtual PRInt32 GetReloadType() const = 0; + + /** @return the loadAttributes pointer */ + virtual nsILoadAttribs* GetLoadAttribs() const = 0; //@} /** Write the URL to aString, overwriting previous contents. */ diff --git a/mozilla/network/module/nsLoadAttribs.cpp b/mozilla/network/module/nsLoadAttribs.cpp new file mode 100644 index 00000000000..259a0399bf5 --- /dev/null +++ b/mozilla/network/module/nsLoadAttribs.cpp @@ -0,0 +1,92 @@ +#include "nsString.h" +#include "nsILoadAttribs.h" +#include "prtypes.h" + +static NS_DEFINE_IID(kILoadAttribs, NS_ILOAD_ATTRIBS_IDD); + +// nsLoadAttribs definition. +class nsLoadAttribs : public nsILoadAttribs { +public: + nsLoadAttribs(); + virtual ~nsLoadAttribs(); + + // nsISupports + NS_DECL_ISUPPORTS + + // nsILoadAttribs + NS_IMETHOD SetBypassProxy(PRBool aBypass); + NS_IMETHOD GetBypassProxy(PRBool *aBypass); + NS_IMETHOD SetLocalIP(const PRUint32 aIP); + NS_IMETHOD GetLocalIP(PRUint32 *aIP); + +private: + PRBool mBypass; + PRUint32 mLocalIP; +}; + +// nsLoadAttribs Implementation + +NS_IMPL_ADDREF(nsLoadAttribs) +NS_IMPL_RELEASE(nsLoadAttribs) + +nsresult +nsLoadAttribs::QueryInterface(const nsIID &aIID, void** aInstancePtr) +{ + if (NULL == aInstancePtr) { + return NS_ERROR_NULL_POINTER; + } + static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + + if (aIID.Equals(kILoadAttribs)) { + *aInstancePtr = (void*) ((nsILoadAttribs*)this); + AddRef(); + return NS_OK; + } + if (aIID.Equals(kISupportsIID)) { + *aInstancePtr = (void*) ((nsISupports *)this); + AddRef(); + return NS_OK; + } + return NS_NOINTERFACE; +} + +nsLoadAttribs::nsLoadAttribs() { + mBypass = PR_FALSE; + mLocalIP = 0; +} + +nsLoadAttribs::~nsLoadAttribs() { +} + +nsresult +nsLoadAttribs::SetBypassProxy(PRBool aBypass) { + mBypass = aBypass; + return NS_OK; +} + +nsresult +nsLoadAttribs::GetBypassProxy(PRBool *aBypass) { + *aBypass = mBypass; + return NS_OK; +} + +nsresult +nsLoadAttribs::SetLocalIP(const PRUint32 aLocalIP) { + mLocalIP = aLocalIP; + return NS_OK; +} + +nsresult +nsLoadAttribs::GetLocalIP(PRUint32 *aLocalIP) { + *aLocalIP = mLocalIP; + return NS_OK; +} + +// Creation routines +NS_NET nsresult NS_NewLoadAttribs(nsILoadAttribs** aInstancePtrResult) { + nsILoadAttribs* it = new nsLoadAttribs(); + if (nsnull == it) { + return NS_ERROR_OUT_OF_MEMORY; + } + return it->QueryInterface(kILoadAttribs, (void **) aInstancePtrResult); +} \ No newline at end of file diff --git a/mozilla/network/module/nsNetService.cpp b/mozilla/network/module/nsNetService.cpp index 81ca085bcbc..267ebadc8fc 100644 --- a/mozilla/network/module/nsNetService.cpp +++ b/mozilla/network/module/nsNetService.cpp @@ -20,7 +20,6 @@ #include "nsITimer.h" #include "nsNetService.h" #include "nsNetStream.h" -#include "net.h" #include "nsNetFile.h" extern "C" { #include "mkutils.h" @@ -204,6 +203,43 @@ nsNetlibService::~nsNetlibService() NET_ShutdownNetLib(); } +void nsNetlibService::SetupURLStruct(nsIURL *aUrl, URL_Struct *aURL_s) { + nsresult result; + NET_ReloadMethod reloadType; + nsILoadAttribs* loadAttribs = aUrl->GetLoadAttribs(); + PRInt32 type = aUrl->GetReloadType(); + + /* Set the NET_ReloadMethod to correspond with what we've + * been asked to do. + * + * 0 = nsReload (normal) + * 1 = nsReloadBypassCache + * 2 = nsReloadBypassProxy + * 3 = nsReloadBypassCacheAndProxy + */ + if (type == 1 || type == 3) { + reloadType = NET_SUPER_RELOAD; + } else { + reloadType = NET_NORMAL_RELOAD; + } + + + /* If this url has load attributes, setup the underlying url struct + * accordingly. */ + if (loadAttribs) { + PRUint32 localIP = 0; + if (type == 2 || type == 3) { + result = loadAttribs->GetBypassProxy((int *)&(aURL_s->bypassProxy)); + if (result != NS_OK) + aURL_s->bypassProxy = FALSE; + } + + result = loadAttribs->GetLocalIP(&localIP); + if (result != NS_OK) + localIP = 0; + aURL_s->localIP = localIP; + } +} nsresult nsNetlibService::OpenStream(nsIURL *aUrl, nsIStreamListener *aConsumer) @@ -213,6 +249,7 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl, nsIProtocolConnection *pProtocol; nsresult result; NET_ReloadMethod reloadType; + nsILoadAttribs* loadAttribs = nsnull; if ((NULL == aConsumer) || (NULL == aUrl)) { return NS_FALSE; @@ -235,23 +272,14 @@ nsresult nsNetlibService::OpenStream(nsIURL *aUrl, /* Create the URLStruct... */ - /* Set the NET_ReloadMethod to correspond with what we've - * been asked to do. - * - * 0 = nsReload (normal) - * 1 = nsReloadBypassCache - * 2 = nsReloadBypassProxy - */ - if (aUrl->GetReloadType() == 1) - reloadType = NET_SUPER_RELOAD; - else - reloadType = NET_NORMAL_RELOAD; URL_s = NET_CreateURLStruct(aUrl->GetSpec(), reloadType); if (NULL == URL_s) { pConn->Release(); return NS_FALSE; } + SetupURLStruct(aUrl, URL_s); + /* * Mark the URL as background loading. This prevents many * client upcall notifications... @@ -313,6 +341,8 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl, nsNetlibStream *pBlockingStream; nsIProtocolConnection *pProtocol; nsresult result; + nsILoadAttribs* loadAttribs = nsnull; + if (NULL == aNewStream) { @@ -351,18 +381,6 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl, /* Create the URLStruct... */ - /* Set the NET_ReloadMethod to correspond with what we've - * been asked to do. - * - * 0 = nsReload (normal) - * 1 = nsReloadBypassCache - * 2 = nsReloadBypassProxy - */ - if (aUrl->GetReloadType() == 1) - reloadType = NET_SUPER_RELOAD; - else - reloadType = NET_NORMAL_RELOAD; - URL_s = NET_CreateURLStruct(aUrl->GetSpec(), reloadType); if (NULL == URL_s) { pBlockingStream->Release(); @@ -370,6 +388,8 @@ nsresult nsNetlibService::OpenBlockingStream(nsIURL *aUrl, goto loser; } + SetupURLStruct(aUrl, URL_s); + #if defined(XP_WIN) /* * When opening a blocking HTTP stream, perform a synchronous DNS diff --git a/mozilla/network/module/nsNetService.h b/mozilla/network/module/nsNetService.h index 21bb0591eac..50f8536d3c0 100644 --- a/mozilla/network/module/nsNetService.h +++ b/mozilla/network/module/nsNetService.h @@ -22,6 +22,7 @@ #include "nspr.h" #include "nsIPref.h" #include "nsINetService.h" +#include "net.h" class nsINetContainerApplication; class nsITimer; @@ -53,6 +54,7 @@ protected: static void NetPollSocketsCallback(nsITimer* aTimer, void* aClosure); private: + void SetupURLStruct(nsIURL *aURL, URL_Struct *aURL_s); /* XXX: This is temporary until bamwrap.cpp is removed... */ void *m_stubContext; nsINetContainerApplication *mContainer; diff --git a/mozilla/network/module/nsURL.cpp b/mozilla/network/module/nsURL.cpp index fe034acda88..1ebcc4cc7a4 100644 --- a/mozilla/network/module/nsURL.cpp +++ b/mozilla/network/module/nsURL.cpp @@ -52,6 +52,7 @@ public: virtual PRBool operator==(const nsIURL& aURL) const; virtual nsresult Set(const char *aNewSpec); virtual nsresult SetReloadType(const PRInt32 type); + virtual nsresult SetLoadAttribs(nsILoadAttribs *aLoadAttrib); virtual const char* GetProtocol() const; virtual const char* GetHost() const; @@ -62,6 +63,7 @@ public: virtual PRInt32 GetPort() const; virtual nsISupports* GetContainer() const; virtual PRInt32 GetReloadType() const; + virtual nsILoadAttribs* GetLoadAttribs() const; virtual void ToString(nsString& aString) const; @@ -72,6 +74,7 @@ public: char* mRef; char* mSearch; nsISupports* mContainer; + nsILoadAttribs* mLoadAttribs; // The reload type can be set to one of the following. // 0 - normal reload (uses cache) (defined as nsReload in nsIWebShell.h) @@ -101,6 +104,7 @@ URLImpl::URLImpl(const nsString& aSpec) mSpec = nsnull; mContainer = nsnull; mReloadType = 0; + mLoadAttribs = nsnull; ParseURL(nsnull, aSpec); } @@ -123,6 +127,7 @@ URLImpl::URLImpl(const nsString& aSpec, nsISupports* container) } else { mContainer = nsnull; } + mLoadAttribs = nsnull; ParseURL(nsnull, aSpec); } @@ -141,6 +146,7 @@ URLImpl::URLImpl(const nsIURL* aURL, const nsString& aSpec) mSpec = nsnull; mContainer = nsnull; mReloadType = 0; + mLoadAttribs = nsnull; ParseURL(aURL, aSpec); } @@ -180,6 +186,7 @@ URLImpl::~URLImpl() { NS_IF_RELEASE(mProtocolUrl); NS_IF_RELEASE(mContainer); + NS_IF_RELEASE(mLoadAttribs); PR_FREEIF(mSpec); PR_FREEIF(mProtocol); @@ -202,6 +209,14 @@ nsresult URLImpl::SetReloadType(const PRInt32 type) return NS_OK; } +nsresult URLImpl::SetLoadAttribs(nsILoadAttribs *aLoadAttrib) +{ + NS_PRECONDITION( (aLoadAttrib != nsnull), "Null pointer."); + mLoadAttribs = aLoadAttrib; + NS_ADDREF(mLoadAttribs); + return NS_OK; +} + PRBool URLImpl::operator==(const nsIURL& aURL) const { @@ -256,6 +271,11 @@ PRInt32 URLImpl::GetReloadType() const return mReloadType; } +nsILoadAttribs* URLImpl::GetLoadAttribs() const +{ + return mLoadAttribs; +} + void URLImpl::ToString(nsString& aString) const { // XXX Special-case javascript: URLs for the moment. diff --git a/mozilla/network/protocol/ftp/mkftp.c b/mozilla/network/protocol/ftp/mkftp.c index 2f79209270a..b42733a5b36 100644 --- a/mozilla/network/protocol/ftp/mkftp.c +++ b/mozilla/network/protocol/ftp/mkftp.c @@ -4130,7 +4130,8 @@ net_ProcessFTP(ActiveEntry * ce) ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); ce->socket = cd->cc->csock; if(cd->cc->csock != NULL) @@ -4160,7 +4161,8 @@ net_ProcessFTP(ActiveEntry * ce) &cd->cc->csock, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); cd->pause_for_read = TRUE; @@ -4302,7 +4304,8 @@ net_ProcessFTP(ActiveEntry * ce) ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); if(ce->status == MK_CONNECTED) { @@ -4324,7 +4327,8 @@ net_ProcessFTP(ActiveEntry * ce) &cd->dsock, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); TRACEMSG(("FTP: got pasv data connection on port #%d\n",cd->cc->csock)); if(ce->status == MK_CONNECTED) diff --git a/mozilla/network/protocol/gopher/mkgopher.c b/mozilla/network/protocol/gopher/mkgopher.c index 540fdce2464..ca15c8d4a71 100644 --- a/mozilla/network/protocol/gopher/mkgopher.c +++ b/mozilla/network/protocol/gopher/mkgopher.c @@ -1007,7 +1007,8 @@ net_ProcessGopher(ActiveEntry * cur_entry) CE_WINDOW_ID, &CE_URL_S->error_msg, cur_entry->socks_host, - cur_entry->socks_port); + cur_entry->socks_port, + cur_entry->URL_s->localIP); if(CE_SOCK != NULL) NET_TotalNumberOfOpenConnections++; @@ -1033,7 +1034,8 @@ net_ProcessGopher(ActiveEntry * cur_entry) &CE_SOCK, &CD_TCP_CON_DATA, CE_WINDOW_ID, - &CE_URL_S->error_msg); + &CE_URL_S->error_msg, + cur_entry->URL_s->localIP); if(CE_STATUS == MK_CONNECTED) { CD_NEXT_STATE = GOPHER_SEND_REQUEST; diff --git a/mozilla/network/protocol/http/mkhttp.c b/mozilla/network/protocol/http/mkhttp.c index 065ae3cf902..38ce030046c 100644 --- a/mozilla/network/protocol/http/mkhttp.c +++ b/mozilla/network/protocol/http/mkhttp.c @@ -489,7 +489,8 @@ net_start_http_connect(ActiveEntry * ce) { ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); } else { ce->status = NET_BeginConnect (ce->URL_s->address, ce->URL_s->IPAddressString, @@ -501,7 +502,8 @@ net_start_http_connect(ActiveEntry * ce) { ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); } /* set this so mkgeturl can select on it */ @@ -609,7 +611,8 @@ net_finish_http_connect(ActiveEntry * ce) &cd->connection->sock, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); } else { ce->status = NET_FinishConnect(ce->URL_s->address, "HTTP", @@ -617,7 +620,8 @@ net_finish_http_connect(ActiveEntry * ce) &cd->connection->sock, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); } if (ce->status < 0) { diff --git a/mozilla/network/protocol/imap4/mkimap4.cpp b/mozilla/network/protocol/imap4/mkimap4.cpp index 66e21fbf004..9d2233b6a31 100644 --- a/mozilla/network/protocol/imap4/mkimap4.cpp +++ b/mozilla/network/protocol/imap4/mkimap4.cpp @@ -1355,7 +1355,8 @@ void StartIMAPConnection(TNavigatorImapConnection *imapConnection) ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); imapConnection->SetIOSocket(ce->socket); if(ce->socket != 0) @@ -1411,7 +1412,8 @@ void FinishIMAPConnection(void *blockingConnectionVoid, &ce->socket, imapConnection->GetTCPConData(), ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); imapConnection->SetIOSocket(ce->socket); if(ce->status == MK_CONNECTED) diff --git a/mozilla/network/protocol/nntp/mknews.c b/mozilla/network/protocol/nntp/mknews.c index 00112286128..5998979d8fb 100644 --- a/mozilla/network/protocol/nntp/mknews.c +++ b/mozilla/network/protocol/nntp/mknews.c @@ -4760,7 +4760,8 @@ net_ProcessNews (ActiveEntry *ce) ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); if(ce->socket != NULL) NET_TotalNumberOfOpenConnections++; @@ -4810,7 +4811,8 @@ HG33086 &ce->socket, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); cd->pause_for_read = TRUE; if(ce->status == MK_CONNECTED) diff --git a/mozilla/network/protocol/pop3/mkpop3.c b/mozilla/network/protocol/pop3/mkpop3.c index 853b8732b85..ea8eb8f7023 100644 --- a/mozilla/network/protocol/pop3/mkpop3.c +++ b/mozilla/network/protocol/pop3/mkpop3.c @@ -2768,7 +2768,8 @@ net_ProcessPop3 (ActiveEntry *ce) ce->window_id, &ce->URL_s->error_msg, ce->socks_host, - ce->socks_port); + ce->socks_port, + ce->URL_s->localIP); if ((ce->status == MK_UNABLE_TO_CONNECT) || (ce->status == MK_CONNECTION_TIMED_OUT) || @@ -2835,7 +2836,8 @@ net_ProcessPop3 (ActiveEntry *ce) &ce->socket, &cd->tcp_con_data, ce->window_id, - &ce->URL_s->error_msg); + &ce->URL_s->error_msg, + ce->URL_s->localIP); cd->pause_for_read = TRUE; diff --git a/mozilla/network/protocol/smtp/mksmtp.c b/mozilla/network/protocol/smtp/mksmtp.c index 67d244f0b34..f4b8dd16efd 100644 --- a/mozilla/network/protocol/smtp/mksmtp.c +++ b/mozilla/network/protocol/smtp/mksmtp.c @@ -1412,7 +1412,8 @@ net_ProcessMailto (ActiveEntry *cur_entry) CE_WINDOW_ID, &CE_URL_S->error_msg, cur_entry->socks_host, - cur_entry->socks_port); + cur_entry->socks_port, + ce->URL_s->localIP); CD_PAUSE_FOR_READ = TRUE; if(CE_STATUS == MK_CONNECTED) { @@ -1435,7 +1436,8 @@ net_ProcessMailto (ActiveEntry *cur_entry) &CE_SOCK, &CD_TCP_CON_DATA, CE_WINDOW_ID, - &CE_URL_S->error_msg); + &CE_URL_S->error_msg, + ce->URL_s->localIP); CD_PAUSE_FOR_READ = TRUE; HG18931