vs missing in response to video request

Issue #3 resolved
Saxon Milton created an issue

Currently trying to push video to netreceiver, but sending is failing due to a response error "vs missing". Note that Jack and I modified the http sender code such that it is doing a video request rather than a poll request, because, with a poll request there was an invalid pin error, presumably as a result from changes for new video handling functionality.

Comments (8)

  1. Alan Noble

    The varsum (vs) is not supposed to be included in video requests, since it is an expensive operation. So this is a client issue, not a NetReceiver issue.

  2. Saxon Milton reporter

    Apologies if It seemed I implied the problem lies in net-receiver - I actually thought it might be either netreceiver or netsender. From another look, I believe it might be an edit Jack and I made to netsender that was not thought out enough. We didn't consider the following in netsender.go:Send()

    // extract var sum, which should be an integer, except when returned with vars
        var vs int
        if requestType == RequestVars {
            var val string
            val, err = extractJsonString(reply, "vs")
            if err != nil {
                return reply, reconfig, errors.New("vs missing")
            }
            vs, err = strconv.Atoi(val)
            if err != nil {
                return reply, reconfig, errors.New("vs not an integer")
            }
        } else {
            vs, err = extractJsonInt(reply, "vs")
            if err != nil {
                return reply, reconfig, errors.New("vs missing")
            }
        }
    

    because we're using "RequestVideo" we're hitting the else, so the vs is wrongly being checked. I can have a go at fixing ?

  3. Jack Richardson

    We added in a request type called RequestVideo that used the /send URL for video (this might get changed in a PR). In the above mentioned code snippet we could change the else statement to be:

    } else {
        if requestType != RequestVideo {
                vs, err = extractJsonInt(reply, "vs")
                if err != nil {
                    return reply, reconfig, errors.New("vs missing")
                }
        }
    }
    

    This will avoid the check. If you're happy with this I'll make the change.

  4. Alan Noble

    The fix needs to be more general than that, since it is not just video requests that skip the varsum, but all requests for "vector data" (i.e., data that is more than a single scalar/number).

    What I had in mind is that scalar data (A, D, X) continue to use /poll while vector data (V, B, T) use the new /recv.

    Vidgrind already implements /recv, but I need to back port it to NetReceiver.

    So: - Generalize RequestVideo to RecquestRecv - And use /recv for V, B, and T data

  5. Log in to comment