mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-26 18:28:32 +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) {
|
if (xfer_len > 0) {
|
||||||
//printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len));
|
//printf("URB: %s\n", osmo_hexdump(&buf[buf_i], xfer_len));
|
||||||
buf_i += xfer_len;
|
buf_i += xfer_len;
|
||||||
if (buf_i>=sizeof(buf)) {
|
if (buf_i >= sizeof(buf)) {
|
||||||
perror("preventing USB buffer overflow");
|
perror("preventing USB buffer overflow");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int processed = process_usb_msg(buf, buf_i);
|
int processed;
|
||||||
if (processed > 0 && processed <= buf_i) {
|
while ((processed = process_usb_msg(buf, buf_i)) > 0) {
|
||||||
|
if (processed > buf_i) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
for (i = processed; i < buf_i; i++) {
|
for (i = processed; i < buf_i; i++) {
|
||||||
buf[i-processed] = buf[i];
|
buf[i-processed] = buf[i];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user