Unified · Split
| @@ -20,6 +20,7 @@ enum { · 19 unmodified lines | ||
| 20 | 20 | Type2, |
| 21 | 21 | Type3, |
| 22 | 22 | |
| 23 | + CSUserCtl = 2, | |
| 23 | 24 | CSCtl = 3, |
| 24 | 25 | |
| 25 | 26 | CbCommand = 0, |
| @@ -372,6 +373,16 @@ rtmpfree(RTMP *r) · 346 unmodified lines | ||
| 372 | 373 | free(r); |
| 373 | 374 | } |
| 374 | 375 | |
| 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 | + | |
| 375 | 386 | static void |
| 376 | 387 | loop(void *aux) |
| 377 | 388 | { |
| @@ -472,8 +483,8 @@ loop(void *aux) · 94 unmodified lines | ||
| 472 | 483 | case CtlStreamIsRecorded: |
| 473 | 484 | if(0){ |
| 474 | 485 | case CtlPingRequest: |
| 475 | − /* FIXME pong */ | |
| 476 | − USED(n); | |
| 486 | + if(pong(r, n) != 0) | |
| 487 | + goto err; | |
| 477 | 488 | } |
| 478 | 489 | if(debug) |
| 479 | 490 | fprint(2, ": %s %d", ctl2s[s16], n); |