Closed comex closed 4 years ago
Any idea what was sending zero-byte response fragments?
investigates
It was GetNroInfos
returning an empty vector. In fact, it seems like it always returns an empty vector at the moment, as nro_info
never gets assigned to.
Then PackingHelper
for std::vector<T>
does
w.Write<uint64_t>(vec.size());
w.Write(vec);
and the latter Write call (to ResponseWriter
) does
return Write((uint8_t*) data.data(), data.size() * sizeof(T));
Mmm, makes sense. Probably explains the issues I had with NRO stuff in GDB stub.
Both the USB and TCP bridge had issues in this case. For USB, it would try to send a 0-byte USB packet but the USB stack would return an error. For TCP, it seems like bsd_send would return 0 and twili would then interpret that as an error (haven't actually tested this).