On Tue, Apr 10, 2012 at 03:53:17PM +0300, Yonit Halperin wrote:
> On 04/10/2012 03:34 PM, Christophe Fergeau wrote:
> >On Sun, Apr 08, 2012 at 06:43:15PM +0300, Yonit Halperin wrote:
> >>+static void red_channel_client_net_monitor_qos_timer(void *opaque)
> >>+{
> >>+    RedChannelClient *rcc = opaque;
> >>+    int *qos_state =&rcc->net_monitor.qos.state;
> >>+
> >>+    spice_assert(*qos_state != NET_MONITOR_STATE_INVALID);
> >>+
> >>+    if (*qos_state == NET_MONITOR_STATE_COMPLETE) {
> >>+        *qos_state = NET_MONITOR_STATE_PENDING;
> >>+        rcc->net_monitor.qos.size_th = NET_MONITOR_QOS_QUERY_SIZE;
> >
> >size_th ? what does that mean?
> >
> th=threshold. The minimal size we require for sending QOS_QUERY

I'd use the full name then, same in one of the followup patches.

> >>+    } else {
> >>+        spice_assert(*qos_state == NET_MONITOR_STATE_PENDING);
> >>+        rcc->net_monitor.qos.size_th = MAX(NET_MONITOR_QOS_QUERY_SIZE_MIN,
> >>+                                           (rcc->net_monitor.qos.size_th - 
> >>10000));
> >
> >Why the - 10000?
> >
> Since the timeout reached, and we no message reached the size limit,
> I chose to decrease the limit (for example, if the resolution is
> very small, we will never reach the threshold). 10000 was arbitrary
> choice.
> >>+        rcc->channel->core->timer_start(rcc->net_monitor.qos.timer, 
> >>NET_MONITOR_TIMEOUT_MS / 2);
> >
> >Why half the timeout?
> >
> In order not to wait too much time.


I'd add a comment explaining these 2 things then since they are arbitrary
choices, and things would probably work without these changes.

Christophe

Attachment: pgpqB9ltH7kLr.pgp
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to