rem: (memcmp(_msg->first_line.u.request.method.s, "CANCEL", 6))) {
add: (memcmp(_msg->first_line.u.request.method.s, "CANCEL", 6))) { */ if (_msg->REQ_METHOD==METHOD_ACK || _msg->REQ_METHOD==METHOD_CANCEL ) {
context: static inline int authorize(struct sip_msg* _msg, char* _realm, char* _table, char* _hf_name){	char ha1[256];	int res;	     /* We will have to parse the whole message header	      * since there may be multible authorization header	      * fields	      */	init_cred(&(state.cred));	state.stale = 0;	state.nonce_retries = 0;#ifdef ACK_CANCEL_HACK	if (!memcmp(_msg->first_line.u.request.method.s, "ACK", 3)) {	        return 1;	}#endif	if (parse_headers(_msg, HDR_EOH) == -1) {		LOG(L_ERR, "authorize(): Error while parsing message header\n");		return -1;	}	     /* Finds the first occurence of authorization header for the	      * given realm	      */	if (find_auth_hf(_msg, _realm, &(state.cred), _hf_name) == -1) {		DBG("authorize(): Authorization HF not found or malformed\n");		return -1;	}	     /*	      * FIXME: For debugging purposes only	      */	print_cred(&(state.cred));	/* FIXME: 400s should be sent from routing scripts, but we will need	 * variables for that	 */	if (validate_cred(&(state.cred)) == -1) {		if (send_resp(_msg, 400, MESSAGE_400, NULL, 0) == -1) {			LOG(L_ERR, "authorize(): Error while sending 400 reply\n");		}		return 0;	}	if (!check_nonce(state.cred.nonce.s, &secret)) {		LOG(L_ERR, "authorize(): Invalid nonce value returned, very suspicious\n");		return -1;	}	state.nonce_retries = get_nonce_retry(state.cred.nonce.s);        if (get_ha1(state.cred.username.s, _realm, _table, ha1) == -1) {		LOG(L_ERR, "authorize(): Error while obtaining HA1 string for user \"%s\"\n", state.cred.username.s);		return -1;	}		        res = check_response(&(state.cred), &_msg->first_line.u.request.method, ha1);	if (res == 1) {  /* response was OK */		if (nonce_is_stale(state.cred.nonce.s)) {			if (!(memcmp(_msg->first_line.u.request.method.s, "ACK", 3)) &&			    (memcmp(_msg->first_line.u.request.method.s, "CANCEL", 6))) {				     /* Method is ACK or CANCEL, we must accept stale				      * nonces because there is no way how to challenge				      * with new nonce (ACK and CANCEL have no responses				      * associated)				      */				return 1;			} else {				DBG("authorize(): Response is OK, but nonce is stale\n");				state.stale = 1;				return -1;			}		} else {			DBG("authorize(): Authorization OK\n");			return 1;		}	} else {		DBG("authorize(): Response is different\n");		return -1;	}}