This phrase is used at least twice in the Decameron:
In Day 2 Story 9, when the merchants at the beginning of the story are boasting of their infidelity to their wives and justifying themselves by claiming their wives are equally unfaithful to them:
“I cannot answer for my wife; but for myself I own, that, whenever a girl that is to my mind comes in my way, I give the go-by to the love that I bear my wife, and take my pleasure of the new-comer to the best of my power.” “And so do I,” said another, “because I know that, whether I suspect her or no, my wife tries her fortune, and so 'tis do as you are done by; the ass and the wall are quits.”
In Day 8 Story 8, in Fiammetta's introduction to her story:
Wherefore I am minded to tell you a little story of a young man who bore an affront in a milder temper, and avenged himself with more moderation. Whereby you may understand that one should be satisfied if the ass and the wall are quits, nor by indulging a vindictive spirit to excess turn the requital of a wrong into an occasion of wrong-doing.
The original Italian, as far as I can tell, is "quale asino dà in parete tal riceve". Searching online for the phrase in English yielded only the Decameron itself as a search result, and I didn't come across any explanatory notes about this phrase. What does it mean?
In context, I suppose its meaning is something like "tit for tat" or "sauce for the goose is sauce for the gander", but it might also have a specific meaning related to marital infidelity, as its usage in both stories is related to this. (In my last Decameron question I discovered an unexpected sexual innuendo or euphemism, which apparently is fairly common in the Decameron.) Is (or was) this a common Italian proverb? Does it have any extra significance in the context of these Decameron stories?