MCPcopy Create free account
hub / github.com/ElementsProject/lightning / append_contents

Function append_contents

plugins/commando.c:113–128  ·  view source on GitHub ↗

Append to commando->contents: set to NULL if we've over max. */

Source from the content-addressed store, hash-verified

111
112/* Append to commando->contents: set to NULL if we've over max. */
113static void append_contents(struct commando *commando, const u8 *msg, size_t msglen,
114 size_t maxlen)
115{
116 size_t len = tal_count(commando->contents);
117
118 if (!commando->contents)
119 return;
120
121 if (len + msglen > maxlen) {
122 commando->contents = tal_free(commando->contents);
123 return;
124 }
125
126 tal_resize(&commando->contents, len + msglen);
127 memcpy(commando->contents + len, msg, msglen);
128}
129
130struct reply {
131 struct commando *incoming;

Callers 2

handle_incmdFunction · 0.85
handle_replyFunction · 0.85

Calls 1

tal_freeFunction · 0.85

Tested by

no test coverage detected