/*******************************************/ /* _mhttponcom.pkg : _on by http :-) */ /* by Marc Barilley */ /* inspired by work done by Sylvain Huet */ /* supports switch beetween _on / HTTPsend */ /*******************************************/ fun http_on (c, msg)= _fooS "http_on"; match c with (Http_Chn_Client c -> { _fooS strcat " adding client cmd " strcat "__" mkscript msg; set c.Http_Chn_Client_bufHTTPout = add_http_c c c.Http_Chn_Client_bufHTTPout strcat "__" mkscript msg; flush_http_c c; 0 } ) |(Http_Chn_Server c -> { _fooS strcat " adding server cmd " strcat "__" mkscript msg ; add_http_s c c.Http_Server_Client_Node_bufout strcat "__" mkscript msg; flush_http_s c; 0 } ) |( _ -> {_fooS " channel == NIL !!!!";nil});; fun http_on_setmaxsize (maxsize)= set HTTP_ON_maxsize = maxsize;; fun http_closechannel (c)= match (c) with (Http_Chn_Client c -> { set c.Http_Chn_Client_bufHTTPout = listcat c.Http_Chn_Client_bufHTTPout (Http_Chn_Client_SysCommand Http_Chn_Client_SysCommand_CloseClient)::nil; 0 } ) |(Http_Chn_Server c -> { _deltimer c.Http_Server_Client_Node_timeOutTimer; set c.Http_Server_Client_Node_timeOutTimer = nil; _fooS " je fais le script _closed"; _scriptc c.Http_Server_Client_Node_uchannel "_closed"; _fooS " je tue le canal"; _killchannel c.Http_Server_Client_Node_uchannel; set c.Http_Server_Client_Node_attachedServer.Http_Chn_Server_clients = remove_from_list c.Http_Server_Client_Node_attachedServer.Http_Chn_Server_clients c; 0 } ) |(_ -> nil);; fun http_state (c)= match (c) with (Http_Chn_Client c -> c.Http_Chn_Client_state) |(_ -> nil);;