From: Richard <ri...@bu...> - 2007-11-09 13:26:45
|
Normally one can call api methods like: yaws_api:ehtml_expand({b,'hello world'}). or yaws_api:ehtml_expand( [ {b,'hello'}, {b,'world'} ] ). and all is well. The same works for all of the ehtml tags except one. yaws_api:ehtml_expander({ssi,File,Del,Bs}). This call fails because there is a dependency on two process dictionary entries (yaws_ut and yaws_arg) that are not set until after out finishes executing and control is passed to handler_out_XXX. (another developer repaired a problem in the crash handler by adding two put() calls; my question is: should the put be performed before the out() method is called? YAWS_SERVER.ERL . . . appmod -> yaws:outh_set_dyn_headers(Req, H, UT), {Mod,_} = UT#urltype.data, + put(yaws_ut, UT), + put(yaws_arg, ARG), deliver_dyn_part(CliSock, 0, "appmod", N, ARG,UT, fun(A)->Mod:out(A) end, fun(A)->finish_up_dyn_file(A, CliSock) end ); This might override the need in the crash handler too. opinions please? -Richard |
From: Richard <ri...@bu...> - 2007-11-09 13:32:05
|
Still better... this would be better if implemented here: %% Return values: %% continue, done, {page, Page} deliver_dyn_part(CliSock, % essential params LineNo, YawsFile, % for diagnostic output CliDataPos, % for `get_more' Arg,UT, YawsFun, % call YawsFun(Arg) DeliverCont % call DeliverCont(Arg) % to continue normally ) -> + put(yaws_ut, UT), + put(yaws_arg, Arg), Res = (catch YawsFun(Arg)), On Nov 9, 2007, at 8:26 AM, Richard wrote: Normally one can call api methods like: yaws_api:ehtml_expand({b,'hello world'}). or yaws_api:ehtml_expand( [ {b,'hello'}, {b,'world'} ] ). and all is well. The same works for all of the ehtml tags except one. yaws_api:ehtml_expander({ssi,File,Del,Bs}). This call fails because there is a dependency on two process dictionary entries (yaws_ut and yaws_arg) that are not set until after out finishes executing and control is passed to handler_out_XXX. (another developer repaired a problem in the crash handler by adding two put() calls; my question is: should the put be performed before the out() method is called? YAWS_SERVER.ERL . . . appmod -> yaws:outh_set_dyn_headers(Req, H, UT), {Mod,_} = UT#urltype.data, + put(yaws_ut, UT), + put(yaws_arg, ARG), deliver_dyn_part(CliSock, 0, "appmod", N, ARG,UT, fun(A)->Mod:out(A) end, fun(A)->finish_up_dyn_file(A, CliSock) end ); This might override the need in the crash handler too. opinions please? -Richard |