Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:7209:       void close()    {    object mutex_key = lock->lock();       destruct( fd );    opened = 0;    }       private array(string) write_buf = ({}); -  private void do_the_write_co() { handle(do_the_write); } +     private void do_the_write()    {    object mutex_key = lock->lock();       if (!opened) do_open(mutex_key);    if (!opened) return; -  +  if (!sizeof (write_buf)) return;    mixed err = catch (fd->write(write_buf));    if (err)    catch {    foreach (write_buf, string str)    if (String.width (str) > 8)    werror ("Got wide string in log output: %O\n", str);    };    write_buf = ({});    remove_call_out(do_close_co);    call_out(do_close_co, 10.0);    if (err)    throw (err);    }       int write( string what )    { -  if (!this_object()) return 0; // We've been destructed, return -  object mutex_key = lock->lock(); -  if (!this_object()) return 0; // We've been destructed, return -  -  if (!sizeof(write_buf)) -  call_out(do_the_write_co, 1); +     write_buf += ({ what }); -  +  if (sizeof (write_buf) == 1) +  background_run (1, do_the_write);    return strlen(what);    }   }