From a2aa29ced0ed4793f0c70e72be622e45dbbd5710 Mon Sep 17 00:00:00 2001 From: OBattler Date: Wed, 17 May 2017 22:07:20 +0200 Subject: [PATCH] Revert "Split off the Network configuration from Other peripherals in the Settings dialog and made PCap device configurable;" This reverts commit 1b83ee8fd3151ce96106a5d2f71f8eb9044fb2ad. --- src/net_slirp.c | 33 +++++++-------------------------- 1 file changed, 7 insertions(+), 26 deletions(-) diff --git a/src/net_slirp.c b/src/net_slirp.c index 8e3056e9a..43574eccf 100644 --- a/src/net_slirp.c +++ b/src/net_slirp.c @@ -29,31 +29,7 @@ static queueADT slirpq; /* SLiRP library handle */ static thread_t *poll_tid; static NETRXCB poll_rx; /* network RX function to call */ static void *poll_arg; /* network RX function arg */ - - -#ifdef WALTJE -int slirp_do_log = 1; -# define ENABLE_SLIRP_LOG -#else -int slirp_do_log = 0; -#endif - - -static void -slirp_log(const char *format, ...) -{ -#ifdef ENABLE_SLIRP_LOG - va_list ap; - - if (slirp_do_log) { - va_start(ap, format); - vprintf(format, ap); - va_end(ap); - fflush(stdout); - } -#endif -} -#define pclog slirp_log +static int fizz; /* Instead of calling this and crashing some times @@ -101,7 +77,10 @@ poll_thread(void *arg) pclog("SLiRP: poll event is %08lx\n", evt); while (slirpq != NULL) { - slirp_tic(); + if (++fizz > 1200) { + fizz = 0; + slirp_tic(); + } /* Wait for the next packet to arrive. */ if (QueuePeek(slirpq) == 0) { @@ -145,6 +124,8 @@ network_slirp_setup(uint8_t *mac, NETRXCB func, void *arg) slirpq = QueueCreate(); pclog(" Packet queue is at %08lx\n", &slirpq); + fizz = 0; + /* Save the callback info. */ poll_rx = func; poll_arg = arg;