[Devel] register_script_cb problems?
Bogdan-Andrei Iancu
bogdan at voice-system.ro
Mon Jun 20 09:52:53 CEST 2005
Hi Ingo,
indeed there is small bug in the code - in second block, the "if" must
test against "RPL_TYPE_CB" flag - looks like copy and paste error :(.
regarding the error message you get: note that in head version the
callbacks were split in two type: callback for request and for replies
(before all were fixed and called for both types of messages).
When you register a callback you have to specify two flags: (REQ_TYPE_CB
or RPL_TYPE_CB - both can pe set) and (PRE_SCRIPT_CB or POST_SCRIPT_CB -
only one can e set).
most probably your module doesn't set the xxx_TYPE_CB flag.
thanks for reporting, the bug is fixed on cvs head.
regards,
bogdan
Ingo Wolfsberger wrote:
>Hi
>
>When I start my HEAD openser proxy, I get:
>BUG:register_script_cb: REQUEST or REPLY type not specified
>
>Function modules/sl/sl.c calls it wrong?
>register_script_cb( sl_filter_ACK, PRE_SCRIPT_CB, 0 );
>
>And in script_cb.c:
>register_scrbt_cb function:
> if (type&REQ_TYPE_CB) {
> /* callback for request script */
> if (type&PRE_SCRIPT_CB) {
> if (add_callback( &pre_req_cb, f, param)<0)
> goto add_error;
> } else if (type&POST_SCRIPT_CB) {
> if (add_callback( &post_req_cb, f, param)<0)
> goto add_error;
> }
> }
> if (type&REQ_TYPE_CB) {
> /* callback (also) for reply script */
> if (type&PRE_SCRIPT_CB) {
> if (add_callback( &pre_rpl_cb, f, param)<0)
> goto add_error;
> } else if (type&POST_SCRIPT_CB) {
> if (add_callback( &post_rpl_cb, f, param)<0)
> goto add_error;
> }
> }
>
>That are 2 times the same if?
>Or should the second be:
>if(type&RPL_TYPE_CB) {
>?
>
>bye,
> Ingo
>
>
>
More information about the Devel
mailing list