mirror of
https://github.com/emanuele-f/PCAPdroid.git
synced 2026-07-03 21:21:12 +08:00
Only stop PCAP dump after capture
This ensures that all the monitored data is actually exported, avoiding a possible inconsistency between the data shown on the screen and the exported PCAP data.
This commit is contained in:
parent
6c8abf92c5
commit
1463e1656f
@ -878,9 +878,7 @@ public class CaptureService extends VpnService implements Runnable {
|
||||
return;
|
||||
|
||||
captureService.mStopping = true;
|
||||
|
||||
stopPacketLoop();
|
||||
captureService.signalServicesTermination();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
captureService.stopForeground(STOP_FOREGROUND_REMOVE);
|
||||
|
||||
@ -533,6 +533,9 @@ static void process_pcapd_rv(pcapdroid_t *pd, int rv) {
|
||||
case PCAPD_PCAP_READ_ERROR:
|
||||
log_f(PD_ERR_PCAP_READ);
|
||||
break;
|
||||
case PCAPD_SOCKET_WRITE_ERROR:
|
||||
// ignore, as it can be caused by PCAPdroid stopping the capture
|
||||
break;
|
||||
default:
|
||||
log_f("pcapd daemon exited with code %d", rv);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user