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