[PATCH] FMS Logs: unexpected bw response from client
Hi All, we were having problems with FMs logging tons of messages similar to the following in the core log file: 2011-02-07 17:58:26 4528 (w)2611397 Invalid command message data: unexpected bw response from client 085DD320 (127.0.0.1) - I traced it back to the SendCheckBWResult method encoding a negative value that was generated by converting the double value returned from SendCheckBW to an integer. The value should be a positive number, greater than 0, for FMS to not log the error. There's probably a better value to pass here but for now this will silence the FMS errors and probably prevent some CDNs from blocking the app. Let me know if ya'll have any questions, thanks! Index: rtmp.c =================================================================== --- rtmp.c (revision 555) +++ rtmp.c (working copy) @@ -2281,7 +2282,7 @@ { AMFObject obj; AVal method; - int txn; + double txn = 0; int ret = 0, nRes; if (body[0] != 0x02) /* make sure it is a string method name we start with */ { @@ -2299,7 +2300,7 @@ AMF_Dump(&obj); AMFProp_GetString(AMF_GetProp(&obj, NULL, 0), &method); - txn = (int)AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); + txn = AMFProp_GetNumber(AMF_GetProp(&obj, NULL, 1)); RTMP_Log(RTMP_LOGDEBUG, "%s, server invoking <%s>", __FUNCTION__, method.av_val); if (AVMATCH(&method, &av__result)) @@ -2308,14 +2309,14 @@ int i; for (i=0; i<r->m_numCalls; i++) { - if (r->m_methodCalls[i].num == txn) { + if (r->m_methodCalls[i].num == (int)txn) { methodInvoked = r->m_methodCalls[i].name; AV_erase(r->m_methodCalls, &r->m_numCalls, i, FALSE); break; } } if (!methodInvoked.av_val) { - RTMP_Log(RTMP_LOGDEBUG, "%s, received result id %d without matching request", + RTMP_Log(RTMP_LOGDEBUG, "%s, received result id <%0.2f> without matching request", __FUNCTION__, txn); goto leave; } Sincerely, Chris Larsen
participants (1)
-
Chris Larsen