From 7f2bae17fd517cee97f06f0a8fc854ed8b8554a6 Mon Sep 17 00:00:00 2001 From: "mscott%netscape.com" Date: Thu, 13 May 1999 22:52:25 +0000 Subject: [PATCH] Add ability to change the url being used for a connection. This allows us to run multiple urls on a connection which we need for many of the mail protocols. git-svn-id: svn://10.0.0.236/trunk@31488 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/network/module/nsIConnectionInfo.h | 10 ++++++++++ mozilla/network/module/nsNetStream.cpp | 11 +++++++++++ mozilla/network/module/nsNetStream.h | 1 + 3 files changed, 22 insertions(+) diff --git a/mozilla/network/module/nsIConnectionInfo.h b/mozilla/network/module/nsIConnectionInfo.h index 4bf3e678d8f..f2866b3d187 100644 --- a/mozilla/network/module/nsIConnectionInfo.h +++ b/mozilla/network/module/nsIConnectionInfo.h @@ -43,6 +43,16 @@ public: */ NS_IMETHOD GetURL(nsIURL **aURL)=0; + /** + * Set the URL associated with this connection. I added this because it is possible + * to keep a connection open and run different urls on the connection. (i.e. + * for mail protocols or other consumers of the pluggable protocol interface). + * + * @param aURL In parameter + * @result NS_OK if successful + */ + NS_IMETHOD SetURL(nsIURL *aURL) = 0; + /** * Get the input stream associated with this connection * diff --git a/mozilla/network/module/nsNetStream.cpp b/mozilla/network/module/nsNetStream.cpp index 68fa3f05b4b..f0e8ab23447 100644 --- a/mozilla/network/module/nsNetStream.cpp +++ b/mozilla/network/module/nsNetStream.cpp @@ -90,6 +90,17 @@ nsConnectionInfo::GetURL(nsIURL **aURL) return NS_OK; } +NS_IMETHODIMP +nsConnectionInfo::SetURL(nsIURL *aURL) +{ + NS_IF_RELEASE(pURL); // release old one + pURL = aURL; + NS_IF_ADDREF(pURL); // now addref new one + + return NS_OK; +} + + NS_IMETHODIMP nsConnectionInfo::GetInputStream(nsIInputStream **aStream) { diff --git a/mozilla/network/module/nsNetStream.h b/mozilla/network/module/nsNetStream.h index 2091c4a6d50..e3885d22f99 100644 --- a/mozilla/network/module/nsNetStream.h +++ b/mozilla/network/module/nsNetStream.h @@ -49,6 +49,7 @@ public: nsIStreamListener *aNotify); NS_IMETHOD GetURL(nsIURL **aURL); + NS_IMETHOD SetURL(nsIURL *aURL); NS_IMETHOD GetInputStream(nsIInputStream **aStream); NS_IMETHOD GetOutputStream(nsIOutputStream **aStream); NS_IMETHOD GetConsumer(nsIStreamListener **aConsumer);