Finding accounting hash by key, de-pointerizing accounting_id and adding...

... accounting ids dynamically
For good measure, terminate at buffer + r->uri.len - 1.