Closed Bug 288844 Opened 20 years ago Closed 18 years ago

irc channel calls onStartRequest synchronously and without onStopRequest

Categories

(Other Applications :: ChatZilla, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: Biesinger, Assigned: bugzilla-mozilla-20000923)

References

()

Details

(Whiteboard: [cz-0.9.72][cz-0.9.78])

Attachments

(2 files)

see URL - the irc protocol handler calls onStartRequest on its listener
synchronously, and never calls onStopRequest.

All callbacks from asyncOpen should happen asynchronously; and onStartRequest
calls must be paired with onStopRequest.
I really dislike having the channel impl. at all.

What do you suggest? Calling both with setTimeout?
I'm not sure... newChannel could return an inputstreamchannel with an empty
inputstream. or you could open the window from asyncOpen and throw from it (iirc
that's what external protocols do)
Returning an empty stream is probably not as good an approach as just throwing
from AsyncOpen like the external protocol channel does.
Assignee: rginda → silver
Status: NEW → ASSIGNED
diff seems to have decided I moved the command line handler, but I really moved the content handler's launch code into a function at the top. The content handlers have both gone, as they are not needed - the channel throws from aynscOpen.
Attachment #213184 - Flags: review?(samuel)
Throwing from asyncOpen will show an error page if an irc:// link is clicked in a web page.  Is that really the aim?
Oh, nevermind.  You're throwin NO_CONTENT; that should work.
Attachment #213184 - Flags: review?(samuel) → review+
Checked in --> FIXED.
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [0.9.72]
Whiteboard: [0.9.72] → [cz-0.9.72]
*sigh*

Components.results needs to burn in hell. It doesn't actually have this code, so we're throwing undefined/null.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Throwing 0x804b0011 (which == NS_ERROR_NO_CONTENT if http://twpol.dyndns.org/mozilla/misc/nserror is correct) in trunk from 2006-11-21 actually gets you this error message in the console still:

Error: [Exception... "'<error>' when calling method: [nsIChannel::asyncOpen]"  nsresult: "0x804b0011 (<unknown>)"  location: "<unknown>"  data: no]

Am I missing something really silly? Or does even defining a constant not actually solve the problem?
I blame XPConnect, but throwing it as a constant is the right solution for our code AFAIK. Need a debug build to work out who's spamming that crap to the console.
Attached patch Sucky patchSplinter Review
Blah. Throwing the value just pops up a different error in the js console. Setting components.returnCode to the same thing doesn't, though, and it still works.
Attachment #249342 - Flags: review?(silver)
Comment on attachment 249342 [details] [diff] [review]
Sucky patch

> +const NS_ERROR_MODULE_NETWORK_BASE = 2152398848;

Nit: please use hex format for clarity.

> -    throw Components.results.NS_ERROR_NO_CONTENT;
> +    Components.returnCode = NS_ERROR_NO_CONTENT;

Please put a comment above this saying we don't throw so that we don't get a message on the JS console.

r=silver with those changes.
Attachment #249342 - Flags: review?(silver) → review+
Checking in mozilla/extensions/irc/js/lib/chatzilla-service.js;
/cvsroot/mozilla/extensions/irc/js/lib/chatzilla-service.js,v  <--  chatzilla-service.js
new revision: 1.42; previous revision: 1.41
done
Status: REOPENED → RESOLVED
Closed: 19 years ago18 years ago
Resolution: --- → FIXED
Whiteboard: [cz-0.9.72] → [cz-0.9.72][cz-0.9.78]
I want to note that this is not Necko's fault. XPCOM/XPConnect doesn't really have a way to expose error codes to script (I don't count the hardcoded list it has). Compare bug 13423.
Nobody said it was - we've been blaming XPConnect from the start. ;)
the comment in the patch says:
+//XXXgijs: Because necko is annoying and doesn't expose this error flag, [...]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: