rem: TRACE_LOG("RLS subscription successfully handled\n");
add: DEBUG_LOG("RLS subscription successfully handled\n");
context: static int handle_new_subscription(struct sip_msg *m, const char *xcap_server, int send_error_responses){	rl_subscription_t *s;	int res = 0;		rls_lock();	DEBUG_LOG("handle_new_subscription(rls)\n");	/* create a new subscription structure */	res = rls_create_subscription(m, &s, xcap_server);	if (res != RES_OK) {		rls_unlock();					switch (res) {			case RES_PARSE_HEADERS_ERR:				if (!send_error_responses) return -1; /* "unprocessed" */				add_response_header(m, "Reason-Phrase: Bad or missing headers\r\n");				send_reply(m, 400, "Bad Request");				break;			case RES_SUBSCRIPTION_REJECTED:				/* if (!send_error_responses) return -1; */				/* FIXME: authorization is done before XCAP query, so though it is NOT 				 * resource-list subscription it may be marked as rejected !!! */				DEBUG_LOG("subscription rejected\n");				add_response_header(m, "Reason-Phrase: Subscription rejected\r\n");				send_reply(m, 403, "Forbidden");				break;			case RES_EXPIRATION_INTERVAL_TOO_SHORT:				if (!send_error_responses) return -1; /* "unprocessed" */				add_response_min_expires_header(m);				send_reply(m, 423, "Interval too small");				break;			case RES_BAD_EVENT_PACKAGE_ERR:				if (!send_error_responses) return -1; /* "unprocessed" */				/* TODO: add_response_header(_m, "Allow-Events: \r\n"); */				send_reply(m, 489, "Bad Event");				break;			case RES_BAD_GATEWAY_ERR:				if (!send_error_responses) return -1; /* "unprocessed" */				send_reply(m, 502, "Bad Gateway");				break;			case RES_XCAP_QUERY_ERR:				if (!send_error_responses) return -1; /* "unprocessed" */				add_response_header(m, "Reason-Phrase: XCAP query error\r\n");				send_reply(m, 502, "Bad Gateway");				/*send_reply(m, 500, "Internal error"); */				break;			case RES_XCAP_PARSE_ERR:				if (!send_error_responses) return -1; /* "unprocessed" */				add_response_header(m, "Reason-Phrase: XCAP result parsing error\r\n");				send_reply(m, 500, "Internal error");				break;								default: 				if (!send_error_responses) return -1; /* "unprocessed" */				send_reply(m, 500, "Internal error");		}		return 0;	/* processed */	}	/* send a response */	rls_prepare_subscription_response(s, m);	send_reply(m, 200, "OK");	TRACE_LOG("RLS subscription successfully handled\n");		/* create NOTIFY message 	 * FIXME - this may be a nonsense for polling, because the notifier might not	 * catch up sent notification */	rls_generate_notify(s, 1);		/* free subscription if only polling */	if (sm_subscription_terminated(&s->external) == 0) {		rls_remove(s);	}		rls_unlock();	return 0;}