From ce6887bd0686220ff75edfccbe6b3fbbf9c5d8be Mon Sep 17 00:00:00 2001 From: "darin%netscape.com" Date: Fri, 11 Jul 2003 22:13:30 +0000 Subject: [PATCH] fixes bug 212245 "don't build ftp and gopher directory listing support if protocols are disabled" r=dougt sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@144747 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/netwerk/build/nsNetModule.cpp | 20 ++++++++++++++++--- .../netwerk/streamconv/converters/Makefile.in | 19 +++++++++++++++--- 2 files changed, 33 insertions(+), 6 deletions(-) diff --git a/mozilla/netwerk/build/nsNetModule.cpp b/mozilla/netwerk/build/nsNetModule.cpp index db5f7817d67..f832d3e53ab 100644 --- a/mozilla/netwerk/build/nsNetModule.cpp +++ b/mozilla/netwerk/build/nsNetModule.cpp @@ -221,8 +221,16 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init) /////////////////////////////////////////////////////////////////////////////// +#ifdef NECKO_PROTOCOL_ftp #include "nsFTPDirListingConv.h" +nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result); +#endif + +#ifdef NECKO_PROTOCOL_gopher #include "nsGopherDirListingConv.h" +nsresult NS_NewGopherDirListingConv(nsGopherDirListingConv** result); +#endif + #include "nsMultiMixedConv.h" #include "nsHTTPCompressConv.h" #include "mozTXTToHTMLConv.h" @@ -233,8 +241,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsIDNService, Init) #include "nsBinHexDecoder.h" #endif -nsresult NS_NewFTPDirListingConv(nsFTPDirListingConv** result); -nsresult NS_NewGopherDirListingConv(nsGopherDirListingConv** result); nsresult NS_NewMultiMixedConv (nsMultiMixedConv** result); nsresult MOZ_NewTXTToHTMLConv (mozTXTToHTMLConv** result); nsresult NS_NewHTTPCompressConv (nsHTTPCompressConv ** result); @@ -358,6 +364,7 @@ CreateNewStreamConvServiceFactory(nsISupports* aOuter, REFNSIID aIID, void **aRe return rv; } +#ifdef NECKO_PROTOCOL_ftp static NS_IMETHODIMP CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult) { @@ -381,7 +388,9 @@ CreateNewFTPDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult) NS_RELEASE(inst); /* get rid of extra refcnt */ return rv; } +#endif +#ifdef NECKO_PROTOCOL_gopher static NS_IMETHODIMP CreateNewGopherDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult) { @@ -405,6 +414,7 @@ CreateNewGopherDirListingConv(nsISupports* aOuter, REFNSIID aIID, void **aResult NS_RELEASE(inst); /* get rid of extra refcnt */ return rv; } +#endif static NS_IMETHODIMP CreateNewMultiMixedConvFactory(nsISupports* aOuter, REFNSIID aIID, void **aResult) @@ -711,18 +721,22 @@ static const nsModuleComponentInfo gNetModuleInfo[] = { }, #endif +#ifdef NECKO_PROTOCOL_ftp // from netwerk/streamconv/converters: { "FTPDirListingConverter", NS_FTPDIRLISTINGCONVERTER_CID, NS_ISTREAMCONVERTER_KEY FTP_TO_INDEX, CreateNewFTPDirListingConv }, +#endif +#ifdef NECKO_PROTOCOL_gopher { "GopherDirListingConverter", NS_GOPHERDIRLISTINGCONVERTER_CID, NS_ISTREAMCONVERTER_KEY GOPHER_TO_INDEX, CreateNewGopherDirListingConv - }, + }, +#endif { "Indexed to HTML Converter", NS_NSINDEXEDTOHTMLCONVERTER_CID, diff --git a/mozilla/netwerk/streamconv/converters/Makefile.in b/mozilla/netwerk/streamconv/converters/Makefile.in index 0937de13f45..a9430c1cf4a 100644 --- a/mozilla/netwerk/streamconv/converters/Makefile.in +++ b/mozilla/netwerk/streamconv/converters/Makefile.in @@ -43,9 +43,6 @@ REQUIRES = xpcom \ $(NULL) CPPSRCS = \ - ParseFTPList.cpp \ - nsFTPDirListingConv.cpp \ - nsGopherDirListingConv.cpp \ mozTXTToHTMLConv.cpp \ nsUnknownDecoder.cpp \ nsHTTPCompressConv.cpp \ @@ -56,6 +53,22 @@ CPPSRCS = \ nsMultiMixedConv.cpp \ $(NULL) +# only include FTP directory listing support if the FTP +# protocol is being built. +ifneq (,$(filter ftp,$(NECKO_PROTOCOLS))) +CPPSRCS += \ + ParseFTPList.cpp \ + nsFTPDirListingConv.cpp \ + $(NULL) +endif + +# only include Gopher directory listing support if the Gopher +# protocol is being built. +ifneq (,$(filter gopher,$(NECKO_PROTOCOLS))) +CPPSRCS += \ + nsGopherDirListingConv.cpp \ + $(NULL) +endif ifeq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT))) CPPSRCS += \