mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
host sniff: process remaining usb messages in buffer
Change-Id: I1746c0187b2e5dbef44b4b336fee3bd9ded15079
This commit is contained in:
@@ -276,12 +276,15 @@ static void run_mainloop()
|
||||
if (xfer_len > 0) {
|
||||
//printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len));
|
||||
buf_i += xfer_len;
|
||||
if (buf_i>=sizeof(buf)) {
|
||||
if (buf_i >= sizeof(buf)) {
|
||||
perror("preventing USB buffer overflow");
|
||||
return;
|
||||
}
|
||||
int processed = process_usb_msg(buf, buf_i);
|
||||
if (processed > 0 && processed <= buf_i) {
|
||||
int processed;
|
||||
while ((processed = process_usb_msg(buf, buf_i)) > 0) {
|
||||
if (processed > buf_i) {
|
||||
break;
|
||||
}
|
||||
for (i = processed; i < buf_i; i++) {
|
||||
buf[i-processed] = buf[i];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user