`cursor` should probably stay initialized to `0`, but I think that you should add `req->off` to it here.