Daniel Kouril wrote:
Benjamin Smedberg wrote:

A quick perusal didn't find anything "wrong", but you can remove some code:

You don't need (and shouldn't have) the nsIHttpAuthenticator.idl in your source tree. Necko already contains and exports that file.


Hm, I cannot find it in Mozilla or Gecko SDK distributions (v. 1.4). Should it be there?


You don't need the registrationproc and unregistrationproc hooks... they are optional in the modulecomponentinfo, and you can just set them to null.


I don't think you need the CLASSINFO stuff. The necko implementations of nsIHttpAuthenticator don't use CI, and it doesn't look like anyone uses it in a scriptable context.


I did what you suggested (and updated the archive at http://negotiateauth.mozdev.org/negoauth.tar.gz) but with no success. Here is what I'm doing:
cd /tmp
wget \ http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4/gecko-sdk-i686-pc-linux-gnu-1.4.tar.gz


wget \ http://ftp.mozilla.org/pub/mozilla/releases/mozilla1.4/mozilla-i686-pc-linux-gnu-1.4.tar.gz

wget \
http://negotiateauth.mozdev.org/negoauth.tar.gz

tar xzf gecko-sdk-i686-pc-linux-gnu-1.4.tar.gz
tar xzf mozilla-i686-pc-linux-gnu-1.4.tar.gz
tar xzf negoauth.tar.gz
cd mozilla-1.4/xpcom/sample/negoauth
make -f Makefile.gecko
cp libhttpgssapiauth.so /tmp/mozilla/components
cd /tmp/mozilla
./run-mozilla.sh ./regxpcom

I believe this should work, but obviously doesn't:

./run-mozilla.sh ./xpcshell
js> const Neg=new Components.Constructor("@mozilla.org/network/http-authenticator;1?scheme=negotiate", "nsIHttpAuthenticator");
uncaught exception: [Exception... "Invalid ClassID or ContractID" nsresult: "0x80570017 (NS_ERROR_XPC_BAD_CID)" location: "JS frame :: typein :: <TOP_LEVEL> :: line 1" data: no]


I'm not sure if the .so library is correctly built, is it possible that it must be created by using some special options for compiler and/or linker? Or is there anything else I could try?

Thank you very much for your patience,

--
Dan



i made two tweaks to your tree to make things work. just apply this patch and rebuild your library. it should work. it worked for me.

darin :)
diff -u10 negoauth/Makefile.gecko negoauth-2/Makefile.gecko
--- negoauth/Makefile.gecko     2003-08-18 06:44:31.000000000 -0700
+++ negoauth-2/Makefile.gecko   2003-08-20 19:32:41.000000000 -0700
@@ -11,20 +11,21 @@
                -I$(GECKO_ROOT)/embedstring/include
 GECKO_LDFLAGS  = -L$(GECKO_ROOT)/xpcom/bin -L$(GECKO_ROOT)/nspr/bin \
                -L$(GECKO_ROOT)/embedstring/bin -L$(GECKO_ROOT)/embed_base/bin
 
 XPIDL = $(GECKO_ROOT)/xpcom/bin/xpidl
 CXX = c++
 CFLAGS = -Wall -fno-rtti -fno-exceptions -shared \
        -Wconversion -Wpointer-arith -Wcast-align -Woverloaded-virtual \
        -Wsynth -Wno-ctor-dtor-privacy -pedantic -Wno-long-long -pthread \
        -pipe -O -fPIC
+CXXFLAGS = $(CFLAGS)
 CPPFLAGS = -DXPCOM_GLUE -DMOZILLA_STRICT_API $(GECKO_INCLUDES) 
-I$(GSSAPI_ROOT)/include -DGECKO_SDK
 LDFLAGS  = $(GECKO_LDFLAGS) -L$(GSSAPI_ROOT)/lib \
        -Wl,-h -Wl,libhttpgssapiauth.so 
 LDLIBS  = -lxpcom -lplds4 -lplc4 -lnspr4 -lpthread -ldl
 #      -lgssapi -lkrb5 -lasn1 -lroken -lresolv \
 #      -L/software/openssl-0.9.6/lib -lcrypto
 
 #GECKO_CONFIG_INCLUDE = -include mozilla-config.h 
 
 all: libhttpgssapiauth.so
diff -u10 negoauth/nsHttpGssapiAuth.cpp negoauth-2/nsHttpGssapiAuth.cpp
--- negoauth/nsHttpGssapiAuth.cpp       2003-08-18 06:41:51.000000000 -0700
+++ negoauth-2/nsHttpGssapiAuth.cpp     2003-08-20 19:36:02.000000000 -0700
@@ -37,28 +37,27 @@
       {
       }
 };
 
 NS_IMPL_ISUPPORTS0(nsGssapiContinuationState)
 
 //----------------------------------------------------------------------------- 
 
 nsHttpGssapiAuth::nsHttpGssapiAuth()
 {
-   NS_INIT_ISUPPORTS(); /* XXX is this needed ? */
 }
 
 nsHttpGssapiAuth::~nsHttpGssapiAuth()
 {
 }
 
-NS_IMPL_ISUPPORTS1_CI(nsHttpGssapiAuth, nsIHttpAuthenticator);
+NS_IMPL_ISUPPORTS1(nsHttpGssapiAuth, nsIHttpAuthenticator);
 
 NS_IMETHODIMP
 nsHttpGssapiAuth::ChallengeReceived(nsIHttpChannel *channel,
                                     const char     *challenge,
                                    PRBool          isProxyAuth,
                                     nsISupports   **sessionState,
                                     nsISupports   **continuationState,
                                     PRBool         *identityInvalid)
 {
    LOG(("nsHttpGssapiAuth::ChallengeReceived\n"));

Reply via email to