Brian J. Tarricone wrote:
> i'm not sure if this is the proper group for this; if not, please direct
> me to the appropriate forum.
> 
> i'm trying to write a module/component for authorisation that can make
> use of kerberos to accept and send a custom auth type that we're using at
> my university.
> 
> so i've created a module that implements nsIHttpNotify, and implemented
> OnExamineResponse() and OnModifyRequest().
> 
> my problem occurs, however, in the Init() method of my class.  i use the
> following to register my module with the NetModuleMgr (i first use
> NS_DEFINE_CID() to set up kINetModuleMgrCID):
> 
> nsCOMPtr<nsINetModuleMgr> pNetModuleMgr = do_GetService(kINetModuleMgrCID, &rv);
> rv = pNetModuleMgr->RegisterModule(NS_NETWORK_MODULE_MANAGER_HTTP_REQUEST_CONTRACTID,
>          (nsIHttpNotify *)this);
> rv = 
>pNetModuleMgr->RegisterModule(NS_NETWORK_MODULE_MANAGER_HTTP_RESPONSE_CONTRACTID,
>          (nsIHttpNotify *)this);
> 
> (i hope that doesn't get too mangled by line wrapping.)
> 
> both function calls appear to succeed (return NS_OK), and my Init()
> method exits with NS_OK as well.  then, mozilla quits.  no, it doesn't
> lock up, it doesn't segfault, it just quits.  i don't even see a browser
> window.  i have a few printf's in my module, and shortly after i see that
> my Init() method returns, i get my bash prompt back, and there aren't any
> mozilla-bin's in the process list.
> 
> interesting to note, is when i comment out the second line (register to
> handle requests), but leave in the third line (register to handle
> responses), mozilla starts normally, and every time a load a page, i see
> the printf's from my OnExamineResponse() method.  if i reverse it, and
> comment the third line by leave in the second, i get the problem
> behaviour - mozilla quits for seeminly no reason.
> 
> i've looked at as much documentation as i can find on mozilla.org, and
> run searches through google and google groups, but i can't seem to figure
> out what i am missing.  anybody have any ideas?
> 
> thanks,
> brian


my advice would be to try to follow the implementation in 
nsCookieHTTPNotify as much as possible.  register your component as a 
HTTP startup listener and add your netmodule hooks just as the cookie 
module does (see mozilla/extensions/cookie).

darin


Reply via email to