[Ur] Some more questions:

Marc Weber marco-oweber at gmx.de
Mon Nov 8 11:06:41 EST 2010


Excerpts from Adam Chlipala's message of Mon Nov 08 14:19:08 +0100 2010:
> That function is for freeing a context.  (You'll notice that it doesn't 
> take a second void* argument, like you would expect for the usual 
> 'free'.)  I'll update the manual to fix the confusing wording you point out.
agreed.

> I think it's best to let the compiler infer the best region locations.  
> In the worst case, everything you allocate lives until the end of the 
> page request. 
fine. so it stays allocated (for perfmance reason) but it may be
reassigned on new page requests.

For very large files (say videos) you need streaming. But for those
cases you can create yet another proxy for now and use a server which
supports them.

> For your example, with the present Ur/Web implementation, I would look 
> up the length of the file and then use either 'uw_malloc' or 'malloc' to 
> allocate exactly that many bytes.
If you directly read from process stdout there is no file. Maybe its
best to use kind of

  system(commannd, stdin, bufszize) // bufsize could be -1 meaning use malloc /realloc until process dies, then copy oven to wu_malloced buffer

and let the user choose the buffer size.

So using system("cat path") I could serve reasonable small files easily
and generate pdfs using lout or such easily. I'll have to lookup how to
use blobs then so because files may contain the 0 byte.

> Ur/Web applications already return 404 codes properly for such 
> requests.  This means you can configure your web server/proxy to use its 
> usual 404 page or anything else you like.
Its about "doing it once for all backends" rather than "remember to
setup a 404 error handler depending on the server you're going to
use".

What else could be of interest? gettext support and getting the LANG
HTTP headder attribute? (-> requestHeader)

Marc



More information about the Ur mailing list