httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marco Spinetti <m.spine...@pisa.iol.it>
Subject Re: static page by module
Date Tue, 04 Sep 2007 09:33:11 GMT
It seems that this is the way:

rv = apr_file_open(&file, sconf->html, APR_READ, APR_UREAD | APR_UWRITE 
| APR_GREAD, r->pool);
if (rv != APR_SUCCESS) {
            .......
}
rv = apr_file_info_get(&finfo, APR_FINFO_MIN, file);
if (rv != APR_SUCCESS) {
            apr_file_close(file);
            ......
}
ap_set_content_type(r, "text/html");
ap_send_fd(file, r, 0, finfo.size, &inviati);                         
apr_file_close(file);
return OK;

Is it correct?
Best regards

Marco

Marco Spinetti ha scritto:
> I'm a bit confused how to serve a static page by a module.
> I'm using apache 2.2.4: in particular cases I'd like that my module 
> replies with a static page (/www/static.html).
> Now in these cases my module replies with:
>
> apr_table_set(r->headers_out, "Location", sconf->html);
> apr_table_set(r->headers_out, "Content-Location", sconf->html);
> apr_table_unset(r->headers_out, "Content-Length");
> apr_table_unset(r->headers_out, "Content-Type");
> return HTTP_TEMPORARY_REDIRECT;
>
> but in this way the client makes a new request to the page static.html.
> I'm like to serve the page immediatly without any other request.
> Is it possible?
> Best regards
>
> Marco
>
>


Mime
View raw message