Re: TLS profile
Andrea Campi <[email protected]> Fri, 26 Jul 2002 12:37:19 +0200
| Newsgroups | gmane.network.beep.roadrunner.general |
|---|---|
| Organization | I.NET S.p.A. |
| Message-ID | <[email protected]> |
On Thu, Jul 25, 2002 at 07:08:19PM +0200, Jonas Borgstr?m wrote:
>
> if (not_authenticated) {
>
> g_error_set (error, RR_BEEP_ERROR, RR_BEEP_CODE_AUTH_REQUIRED,
> "You must authenticate first");
> return FALSE;
> }
>
> This would stop the channel from being created and an error frame
> with the error message will be sent to the initiator peer.
>
OK this is working, but I get:
manager::handle_incoming_start rr_channel_server_init failed: RRCAP, You must authenticate first
RRNET-Debug Write 129:
ERR 0 3 . 572 105
Content-Type: application/beep+xml
<error code='421'><![CDATA[Failed to start any profile]]></error>
END
It looks like the error message is not respected:
if (!rr_channel_server_init (channel, item->piggyback,
error)) {
if (error && *error) {
rr_debug1 ("manager::handle_incoming_start "
"rr_channel_server_init failed: %s, %s",
G_OBJECT_TYPE_NAME (G_OBJECT (channel)),
(*error)->message);
g_error_free (*error);
*error = NULL;
}
g_object_unref (G_OBJECT (channel));
channel = NULL;
list = list->next;
continue;
}
break;
}
/* Were we able to start any profile? */
if (channel == NULL) {
g_set_error (error, RR_BEEP_ERROR,
RR_BEEP_CODE_SERVICE_NOT_AVAIL,
"Failed to start any profile");
goto err;
}
Would it be possible not to free the error; then, if channel == NULL,
check whether *error != NULL instead of forcing it? Obviously,
this would only respect the error from the last available profile,
but it would be better than nothing (and in my case, where I only
have one profile, it would be perfect).
Bye,
Andrea
--
Andrea Campi mailto:[email protected]
I.NET S.p.A. http://www.inet.it
Direzione Tecnica - R&D phone: +39 02 32863 ext 1
v. Darwin, 85 - I-20019 fax: +39 02 32863 ext 7705
Settimo Milanese (MI), Italy