ukanth/afwall — pull request #198 by cernekee (2013-09-07 18:34:24+00:00)
Title: NFLOG fixes

This is intended to address the most common NFLOG-related issues seen to date.

Error handling still isn't fantastic. e.g. if the nflog program dies on its own, or fails to start, NflogService doesn't do a very good job reporting the error or restarting the daemon. If users start seeing these problems it's probably worth revisiting.

Getting the exit code from libsuperuser may require library modifications, as setting up an onCommandResultListener callback causes it to log every output line:

```
if (command.onCommandResultListener != null) {
// no reason to store the output if we don't have an OnCommandResultListener
// user should catch the output with an OnLineListener in this case
buffer = Collections.synchronizedList(new ArrayList());
}
[...]
private synchronized void addBuffer(String line) {
if (buffer != null) {
buffer.add(line);
}
}
```

On a long-lived nflog session with many violations, this could consume a great deal of memory.