Ticket #31: remote-comms.diff

File remote-comms.diff, 1.5 KB (added by seth, 3 years ago)

First attempt at a fix for the problem

  • src/RemoteSerializer.cc

     
    26892689                                max_fd = listen_fd_ssl; 
    26902690                        } 
    26912691 
    2692                 if ( io->IsFillingUp() && ! shutting_conns_down ) 
     2692                if ( ! shutting_conns_down && io->IsFillingUp() ) 
    26932693                        { 
    26942694                        Error("queue to parent filling up; shutting down heaviest connection"); 
    26952695 
     
    27162716                        shutting_conns_down = true; 
    27172717                        } 
    27182718 
    2719                 if ( ! io->IsFillingUp() && shutting_conns_down ) 
     2719                if ( shutting_conns_down && ! io->IsFillingUp() ) 
    27202720                        shutting_conns_down = false; 
    27212721 
    27222722                // We cannot rely solely on select() as the there may 
     
    27272727                // FIXME: Fine-tune this (timeouts, flush, etc.) 
    27282728                struct timeval small_timeout; 
    27292729                small_timeout.tv_sec = 0; 
    2730                 small_timeout.tv_usec = io->CanWrite() ? 1 : 10; 
     2730                small_timeout.tv_usec = io->CanWrite() ? 1000 : 10000; 
    27312731 
    27322732                if ( select(max_fd + 1, &fd_read, &fd_write, &fd_except, 
    27332733                                &small_timeout) < 0 ) 
  • src/Net.cc

     
    563563                        // us a lot of idle time, but doesn't delay near-term 
    564564                        // timers too much.  (Delaying them somewhat is okay, 
    565565                        // since Bro timers are not high-precision anyway.) 
    566                         if ( ! using_communication ) 
    567                                 usleep(100000); 
     566                        usleep(100000); 
    568567 
    569568                        // Flawfinder says about usleep: 
    570569                        //