Roxen.git / server / base_server / roxen.pike

version» Context lines:

Roxen.git/server/base_server/roxen.pike:1:   // This file is part of Roxen WebServer.   // Copyright © 1996 - 2009, Roxen IS.   //   // The Roxen WebServer main program.   //   // Per Hedbor, Henrik Grubbström, Pontus Hagland, David Hedbor and others.   // ABS and suicide systems contributed freely by Francesco Chemolli    - constant cvs_version="$Id: roxen.pike,v 1.1115 2012/06/08 14:08:52 mast Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.1116 2012/06/08 14:39:26 mast Exp $";      //! @appears roxen   //!   //! The Roxen WebServer main program.      // The argument cache. Used by the image cache.   ArgCache argcache;      // Some headerfiles   #define IN_ROXEN
Roxen.git/server/base_server/roxen.pike:7404:       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);    }   }