rem: if (start_xpidf_doc(&body, &len) < 0) {
add: if (start_xpidf_doc(&body, BUF_LEN) < 0) { LOG(L_ERR, "send_xpidf_notify(): start_xpidf_doc failed\n");
context: static inline int send_xpidf_notify(struct presentity* _p, struct watcher* _w){	int len;	xpidf_status_t st;	struct to_body parsed;	     /* Send a notify, saved Contact will be put in	      * Request-URI, To will be put in from and new tag	      * will be generated, callid will be callid,	      * from will be put in to including tag	      */	len = BUF_LEN;	if (start_xpidf_doc(&body, &len) < 0) {		return -1;	}	parse_to(_p->uri.s, _p->uri.s + _p->uri.len + 1, &parsed);	if (parsed.error == PARSE_ERROR) {		LOG(L_ERR, "send_xpidf_notify(): Error while parsing\n");		return -2;	}	len = BUF_LEN - body.len;	if (xpidf_add_presentity(&body, &len, &parsed.uri) < 0) {		return -3;	}	switch(_p->state) {	case PS_ONLINE: st = XPIDF_ST_OPEN; break;	default: st = XPIDF_ST_CLOSED; break;	}	len = BUF_LEN - body.len;	if (xpidf_add_address(&body, &len, &parsed.uri, st) < 0) {		return -3;	}	len = BUF_LEN - body.len;	if (end_xpidf_doc(&body, &len) < 0) {		return -5;	}	if (create_headers(_w) < 0) {		LOG(L_ERR, "send_xpidf_notify(): Error while adding headers\n");		return -6;	}	tmb.t_request_within(&method, &headers, &body, _w->dialog, 0, 0);	return 0;}