IdentListener.onParsedRequest Member

Syntax

object.onParsedRequest(e);

Arguments

ArgumentSummary
e

Returns

Remarks

See Also

Source Code

function ident_listener_request(e)
{
function response(str)
{
return e.localPort + " , " + e.remotePort + " : " + str + "\r\n";
};
function validPort(p)
{
return (p >= 1) && (p <= 65535);
};
if (!validPort(e.localPort) || !validPort(e.remotePort))
{
this.connection.sendData(response("ERROR : INVALID-PORT"));
this.connection.disconnect();
return;
}
var found, responses = this.server.responses;
for (var i = 0; i < responses.length; ++i)
{
if ((e.remotePort == responses[i].port) &&
(this.connection._transport.host == responses[i].ip))
{
// charset defaults to US-ASCII
// anything except an OS username should use OTHER
// however, ircu sucks, so we can't do that.
this.connection.sendData(response("USERID : CHATZILLA :" +
responses[i].username));
found = true;
break;
}
}
if (!found)
this.connection.sendData(response("ERROR : NO-USER"));
// Spec gives us a choice: drop the connection, or listen for more queries.
// Since IRC servers will only ever want one name, we disconnect.
this.connection.disconnect();
}