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

Function http_upgrade

connectd/websocketd.c:186–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184}
185
186static void http_upgrade(int fd)
187{
188 u8 buf[65536];
189 size_t len = 0;
190
191 alarm(60);
192 while (!http_headers_complete(buf, len)) {
193 int r;
194 r = read(STDIN_FILENO, buf + len, sizeof(buf) - len);
195 if (r <= 0)
196 bad_http(STDIN_FILENO, "No header end after %zu bytes",
197 len);
198 len += r;
199 }
200 http_respond(STDIN_FILENO, buf, len);
201 alarm(0);
202}
203
204static void lightningd_to_websocket(int lightningfd, int wsfd)
205{

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls 2

http_headers_completeFunction · 0.85
http_respondFunction · 0.85

Tested by 1

mainFunction · 0.68