rem: LOG(L_ERR, "check_message -1-");
context: int check_message(struct sip_msg* _m){	LOG(L_ERR, "check_message -0- _m=%p\n", _m);	if (_m->event) {		event_t *parsed_event;		int *accepts_mimes = NULL;		LOG(L_ERR, "check_message -1-");		if (_m->accept) {			accepts_mimes = get_accept(_m);			if (accepts_mimes) {				char buf[100];				int offset = 0;				int *a = accepts_mimes;				buf[0] = '0';				while (*a) {					offset += sprintf(buf+offset, ":%#06x", *a);					a++;				}				LOG(L_ERR, "pa check_message: accept=%.*s parsed=%s\n",				    _m->accept->body.len, _m->accept->body.s, buf);			}		}		LOG(L_ERR, "check_message -2- accepts_mimes=%p\n", accepts_mimes);		if (!_m->event->parsed)			parse_event(_m->event);		LOG(L_ERR, "check_message -3-\n");		parsed_event = (event_t*)(_m->event->parsed);		LOG(L_ERR, "check_message -4- parsed_event=%p\n", parsed_event);		if (parsed_event && accepts_mimes) {			int i = 0;			int eventtype = parsed_event->parsed;			LOG(L_ERR, "check_message -4- eventtype=%#06x\n", eventtype);			while (event_package_mimetypes[i].event_type != -1) {				LOG(L_ERR, "check_message -4a- eventtype=%#x epm[i].event_type=%#x", 				    eventtype, event_package_mimetypes[i].event_type);				if (eventtype == event_package_mimetypes[i].event_type) {					int j = 0;					int mimetype;					while ((mimetype = event_package_mimetypes[i].mimes[j]) != 0) {						int k = 0;						while (accepts_mimes[k]) {							LOG(L_ERR, "check_message -4c- eventtype=%#x mimetype=%#x accepts_mimes[k]=%#x\n", eventtype, mimetype, accepts_mimes[k]);							if (accepts_mimes[k] == mimetype) {								int am0 = accepts_mimes[0];								/* we have a match */								LOG(L_ERR, "check_message -4b- eventtype=%#x accepts_mime=%#x\n", eventtype, mimetype);								/* move it to front for later */								accepts_mimes[0] = mimetype;								accepts_mimes[k] = am0;								return 0;							}							k++;						}						j++;					}				}				i++;			}			/* else, none of the mimetypes accepted are generated for this event package */			{				char *accept_s = NULL;				int accept_len = 0;				if (_m->accept && _m->accept->body.len) {					accept_s = _m->accept->body.s;					accept_len = _m->accept->body.len;				}				LOG(L_ERR, "check_message(): Accepts %.*s not valid for event package et=%.*s\n",				    _m->accept->body.len, _m->accept->body.s, _m->event->body.len, _m->event->body.s);				return -1;			}		}		LOG(L_ERR, "check_message -5-\n");	}	return 0;}