mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
lightningd: --dev-disconnect support.
We use a file descriptor, so when we consume an entry, we move past it
(and everyone shares a file offset, so this works).
The file contains packet names prefixed by - (treat fd as closed when
we try to write this packet), + (write the packet then ensure the file
descriptor fails), or @ ("lose" the packet then ensure the file
descriptor fails).
The sync and async peer-write functions hook this in automatically.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Header from folded patch 'test-run-cryptomsg__fix_compilation.patch':
test/run-cryptomsg: fix compilation.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
#include <ccan/str/str.h>
|
||||
#include <lightningd/debug.h>
|
||||
#include <lightningd/dev_disconnect.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -9,6 +11,13 @@ void subdaemon_debug(int argc, char *argv[])
|
||||
int i;
|
||||
bool printed = false;
|
||||
|
||||
for (i = 1; i < argc; i++) {
|
||||
if (strstarts(argv[i], "--dev-disconnect=")) {
|
||||
dev_disconnect_init(atoi(argv[i]
|
||||
+ strlen("--dev-disconnect=")));
|
||||
}
|
||||
}
|
||||
|
||||
/* From debugger, tell gdb "return". */
|
||||
for (i = 1; i < argc; i++) {
|
||||
while (streq(argv[i], "--debugger")) {
|
||||
|
||||
Reference in New Issue
Block a user