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

Function http_upgrade

connectd/websocketd.c:190–206  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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