提交 57760ec1 编写于 作者: M Michal Privoznik

Introduce virNetClientStreamRecvHole

This function will fetch previously processed stream holes and
return their sum.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
上级 486656f1
......@@ -52,6 +52,7 @@ virNetClientStreamMatches;
virNetClientStreamNew;
virNetClientStreamQueuePacket;
virNetClientStreamRaiseError;
virNetClientStreamRecvHole;
virNetClientStreamRecvPacket;
virNetClientStreamSendHole;
virNetClientStreamSendPacket;
......
......@@ -584,6 +584,23 @@ virNetClientStreamSendHole(virNetClientStreamPtr st,
}
int
virNetClientStreamRecvHole(virNetClientPtr client ATTRIBUTE_UNUSED,
virNetClientStreamPtr st,
long long *length)
{
if (!st->allowSkip) {
virReportError(VIR_ERR_OPERATION_INVALID, "%s",
_("Holes are not supported with this stream"));
return -1;
}
*length = st->holeLength;
st->holeLength = 0;
return 0;
}
int virNetClientStreamEventAddCallback(virNetClientStreamPtr st,
int events,
virNetClientStreamEventCallback cb,
......
......@@ -67,6 +67,10 @@ int virNetClientStreamSendHole(virNetClientStreamPtr st,
long long length,
unsigned int flags);
int virNetClientStreamRecvHole(virNetClientPtr client,
virNetClientStreamPtr st,
long long *length);
int virNetClientStreamEventAddCallback(virNetClientStreamPtr st,
int events,
virNetClientStreamEventCallback cb,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册