[Devel] checking if publish message body is ok

Juha Heinanen jh at tutpro.com
Sat Apr 28 15:12:36 CEST 2007


while studying presence_xml code for the purpose of implementing
presence_mwi module, i moticed that presence_xml module defines
xml_publ_handl that is used by presence module to check if body of
publish message is ok.

xml_publ_handl returns 1 (ok) if body is empty:

	if ( get_content_length(msg) == 0 )
		return 1;

how can presence module based on this info know if body was empty or
otherwise ok?  body namely MUST be empty when event state is refreshed
and when event state is removed and MUST NOT be empty in initial
publication and when state is modified.

therefore, should xml_publ_handl return three values, e.g., -1 when body
is not ok, 0 when body is empty, and 1 when non-empty body is ok?

or does presence module separately check emptiness of body and only
calls xml_publ_handl when body is not empty?  in that case, should -1 be
returned on empty body?

-- juha



More information about the Devel mailing list