Branch: Tag:

2000-08-28

2000-08-28 12:02:54 by Per Hedbor <ph@opera.com>

Include 'stat' member in return value, this makes it possible to use keep-alive when sending the file (since the length of it is known)

Rev: server/base_server/configuration.pike:1.354

1:   // A vitual server's main configuration   // Copyright © 1996 - 2000, Roxen IS.    - constant cvs_version = "$Id: configuration.pike,v 1.353 2000/08/28 06:52:09 per Exp $"; + constant cvs_version = "$Id: configuration.pike,v 1.354 2000/08/28 12:02:54 per Exp $";   constant is_configuration = 1;   #include <module.h>   #include <module_constants.h>
607:    // file was sent to the browser)    Stdio.File f = lopen("roxen-images/dir/"+from+".gif","r");    if (f) -  { -  return (["file":f, "type":"image/gif"]); -  } else { -  // File not found. +  return (["file":f, "type":"image/gif", "stat":f->stat(),]); +  else    return 0; -  +  // File not found.   } - } +       private static int nest = 0;   
804:    Stdio.File f;       if(f = lopen("roxen-images/"+from+".gif", "r")) -  return (["file":f, "type":"image/gif"]); +  return (["file":f, "type":"image/gif", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".jpg", "r")) -  return (["file":f, "type":"image/jpeg"]); +  return (["file":f, "type":"image/jpeg", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".png", "r")) -  return (["file":f, "type":"image/png"]); +  return (["file":f, "type":"image/png", "stat":f->stat()]);    if(f = lopen("roxen-images/"+from+".xcf", "r")) -  return (["file":f, "type":"image/x-gimp-image"]); +  return (["file":f, "type":"image/x-gimp-image", "stat":f->stat()]);    // File not found.    return 0;   }