Context:
I have a bufferevent_pair, let's call them p0 and p1.
Some entity will write into p0 from time to time and p1 will read from it's end from time to time (Will not read whenever data is available, i.e. sometimes when the read callback is invoked it will no drain anything from p1->input.
I have a read-high-watermark set on the p1 and I expect that p0 will hold all data above this watermark and only max. watermark bytes will be transferred into p1 and whenever the later one is drained, more bytes will be added by libevent into p1->input from p0->input.
But this doesn't happen, and once I have no more data to write into p0, all data that is currently present in p0->input will not be transferred into p1->input ever, it's stuck there.
Am I doing something that is not expected by libevent? The watermark or the time-to-time reading?
I'm using event_base_loop(EVLOOP_ONCE | EVLOOP_NONBLOCK) inside a while. Also I'm triggering the p1 bufferevent for EV_READ once I don't have anything to write and whenever I don't read anything.
I'm expecting libevent to transfer data from p0->input into p1->input in some way without me having to write more data into p0->input