History

pong

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit 12219b11 parent a0e0f7a1 file · +13 −2Browse files

Unified · Split

rtmp.c+13−2
@@ -20,6 +20,7 @@ enum { · 19 unmodified lines
2020 Type2,
2121 Type3,
2222
23+ CSUserCtl = 2,
2324 CSCtl = 3,
2425
2526 CbCommand = 0,
@@ -372,6 +373,16 @@ rtmpfree(RTMP *r) · 346 unmodified lines
372373 free(r);
373374 }
374375
376+static int
377+pong(RTMP *r, s32int n)
378+{
379+ newmsg(r, UserControl, Type0, CSUserCtl);
380+ puti16(CtlPingResponse);
381+ puti32(n);
382+
383+ return rtmpsend(r);
384+}
385+
375386 static void
376387 loop(void *aux)
377388 {
@@ -472,8 +483,8 @@ loop(void *aux) · 94 unmodified lines
472483 case CtlStreamIsRecorded:
473484 if(0){
474485 case CtlPingRequest:
475− /* FIXME pong */
476− USED(n);
486+ if(pong(r, n) != 0)
487+ goto err;
477488 }
478489 if(debug)
479490 fprint(2, ": %s %d", ctl2s[s16], n);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t