Bug 1373103: log TCP read callback log message only if more then 5 callback are pending. r?mjf draft
authorNils Ohlmeier [:drno] <drno@ohlmeier.org>
Wed, 14 Jun 2017 18:35:59 -0700
changeset 594420 d5212379d86c0f70977810b7fce97f0551793268
parent 589954 5801aa478de12a62b2b2982659e787fcc4268d67
child 633418 896fce62cf2f7f2f2421988eac24402d4b41d294
push id64023
push userdrno@ohlmeier.org
push dateThu, 15 Jun 2017 01:36:15 +0000
reviewersmjf
bugs1373103
milestone55.0a1
Bug 1373103: log TCP read callback log message only if more then 5 callback are pending. r?mjf MozReview-Commit-ID: E0oAG89XGwg
media/mtransport/nr_socket_prsock.cpp
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -2089,18 +2089,20 @@ void NrTcpSocketIpc::maybe_post_socket_r
         r_log(LOG_GENERIC, LOG_INFO, "Firing write callback (%u)",
               (uint32_t)buffered_bytes_);
         fire_callback(NR_ASYNC_WAIT_WRITE);
         has_event = true;
       }
     }
     if (poll_flags() & PR_POLL_READ) {
       if (msg_queue_.size()) {
-        r_log(LOG_GENERIC, LOG_INFO, "Firing read callback (%u)",
-              (uint32_t)msg_queue_.size());
+        if (msg_queue_.size() > 5) {
+          r_log(LOG_GENERIC, LOG_INFO, "Firing read callback (%u)",
+                (uint32_t)msg_queue_.size());
+        }
         fire_callback(NR_ASYNC_WAIT_READ);
         has_event = true;
       }
     }
   }
 
   // If any event has been posted, we post a runnable to see
   // if the events have to be posted again.