Branch: Tag:

1999-05-17

1999-05-17 06:45:06 by David Hedbor <david@hedbor.org>

Stop load_image from recursing till the end of the world (or end of the stack at least) with the demo module.

Rev: server/base_server/roxen.pike:1.278

1:   /* -  * $Id: roxen.pike,v 1.277 1999/05/14 02:50:09 neotron Exp $ +  * $Id: roxen.pike,v 1.278 1999/05/17 06:45:06 neotron Exp $    *    * The Roxen Challenger main program.    *
7:    */      // ABS and suicide systems contributed freely by Francesco Chemolli - constant cvs_version="$Id: roxen.pike,v 1.277 1999/05/14 02:50:09 neotron Exp $"; + constant cvs_version="$Id: roxen.pike,v 1.278 1999/05/17 06:45:06 neotron Exp $";      object backend_thread;   object argcache;
2272:    string data;    object file, img;    -  if(!(data=id->conf->try_get_file(f, id))) -  if(!(file=Stdio.File(f,"r")) || (!(data=file->read()))) +  if(id->misc->_load_image_called < 5) { +  // We were recursing very badly with the demo module here... +  id->misc->_load_image_called++; +  if(!(data=id->conf->try_get_file(f, id))) { +  file=Stdio.File(); +  if(!file->open(f,"r") || !(data=file->read))    return 0; -  +  } +  } +  id->misc->_load_image_called = 0; +  if(!data) return 0;    return low_decode_image( data );   }