My application is observing requests and responses using nsIHttpNotify interface. It needs information both from onModifyRequest and from onExamineResponse to decide if it makes sense to store certain request data. My current approach is global variable which is filled with data at onModifyRequest, and then at onExamineResponse. The problem is that nsIHttpNotify implementations are called in parallel by subsequent requests, which blows my application big time.
Assuming that it isn't possible to make mozilla somehow synchronized on this subject, I have to fix my application. Looks like all I have to do is to bind extracted information with outgoing request. Then later, at onExamineResponse I can match response with extracted data and fill it up if necessary. The binding must be unique, and that seems quite hard to acomplish. The most easiest way seems to be: onModifyRequest: - generate id - nsIHttpChannel.setRequestHeader('MyAppId', id, false); - extract data and store it with id onExamineResposne: - nsIHttpChannel.getRequestHeader('MyAppId'); - lookup data for id ...but this involves actually change in outgoing data. I would like to avoid that if possible. However, I didn't find anything in nsIHttpChannel or nsIChannel, that would be unique enough to identify particular request. I was thinking about nsIChannel.URI.asciiSpec, but it is possible for the same URL to appear multiple times across single document (multiple blank.gif images or so), so this won't do. Any hint would be greatly appreciated :) regards, -- Jacek Prucia _______________________________________________ Mozilla-netlib mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-netlib