Guest User

Untitled

a guest
Nov 24th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. static int
  2. HandleInvoke(RTMP *r, const char *body, unsigned int nBodySize)
  3. {
  4. AMFObject obj;
  5. AVal method;
  6. int txn;
  7. int ret = 0, nRes;
  8. if (body[0] != 0x02) /* make sure it is a string method name we start with */
  9. {
  10. RTMP_Log(RTMP_LOGWARNING, "%s, Sanity failed. no string method in invoke packet",
  11. __FUNCTION__);
  12. return 0;
  13. }
  14.  
  15. nRes = AMF_Decode(&obj, body, nBodySize, FALSE);
  16. if (nRes < 0)
  17. {
  18. RTMP_Log(RTMP_LOGERROR, "%s, error decoding invoke packet", __FUNCTION__);
  19. return 0;
  20. }
  21.  
  22. AMF_Dump(&obj);
  23. AMFProp_GetString(AMF_GetProp(&obj, NULL, 0), &method);
  24. txn = (int)AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1));
  25. RTMP_Log(RTMP_LOGDEBUG, "%s, server invoking <%s>", __FUNCTION__, method.av_val);
Add Comment
Please, Sign In to add comment