I was reminded of this when I ran into the Ranger's Apprentice series while researching another book. It was a fantasy book, I think, that I read in early college, around 1999, in English, maybe as a paperback. The main character winds up as the apprentice to a forest ranger of some flavor. At some point, a metal canteen becomes horribly dented (maybe during a fight?) and the ranger fixes it by filling the canteen with grain and then adding water before capping it. The expanding grain causes the dents in the canteen to be pushed out. Said ranger later dies, although I don't remember if it was from wounds in battle, or from disease or old age (although for some reason, my brain keeps coming back to the idea of him dying of rabies after being wounded subduing an animal with the disease). Later, the protagonist is with a group that's trying to get into a city which is walled and locked up. He convinces them to follow his plan, which involves wedging two nested pipes into the doorway of the gate into the city, which are filled with soaked grain, the idea being that the expansion will cause the pipes to push out with great force, breaking the gates. They plant the devices, with some losses, and at first, it looks like the devices are doing nothing, and the loss was for naught, but then they start working and break the gates.
I am not 100% certain that it was a fantasy series now that I think about it. I think the mentor was indeed described as a "ranger", and I have a hazy memory of orcs and a darkness spell, but I might be channeling Mooshie from the Drizz't books.
The only other things I remember was an early scene involving a religious order where a religious brother tried to convince one of the nuns that semen was liquid communion, and some other scene involving the main character "curing" an epileptic through sex, only to see them get into an honor battle and having their head smashed in.