summaryrefslogtreecommitdiffstats
path: root/slirp/sbuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/sbuf.c')
-rw-r--r--slirp/sbuf.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/slirp/sbuf.c b/slirp/sbuf.c
index 5a1ccbf..637f8fe 100644
--- a/slirp/sbuf.c
+++ b/slirp/sbuf.c
@@ -6,6 +6,7 @@
*/
#include <slirp.h>
+#include <main-loop.h>
static void sbappendsb(struct sbuf *sb, struct mbuf *m);
@@ -18,6 +19,8 @@ sbfree(struct sbuf *sb)
void
sbdrop(struct sbuf *sb, int num)
{
+ int limit = sb->sb_datalen / 2;
+
/*
* We can only drop how much we have
* This should never succeed
@@ -29,6 +32,9 @@ sbdrop(struct sbuf *sb, int num)
if(sb->sb_rptr >= sb->sb_data + sb->sb_datalen)
sb->sb_rptr -= sb->sb_datalen;
+ if (sb->sb_cc < limit && sb->sb_cc + num >= limit) {
+ qemu_notify_event();
+ }
}
void
OpenPOWER on IntegriCloud