httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Javier Vela <jvdi...@gmail.com>
Subject ap_send_fd() don't send anything
Date Wed, 05 Nov 2008 23:14:11 GMT
Hi, I'm writing a module for one project and for start, I'm writing a simple 
one but I have problems with the ap_send_fd() function. When I call this 
function after open the file with apr_file_open() I use this:

	ap_send_fd (f, r, offset, r->finfo.size, &nbytes)

where offset's value is 0. I checked the file and it exists and it's opened 
correctly by apr_file_open().The problem is that don't send anything. The 
value of nbytes after the function is always 0. I have read some forums and I 
have tried to use ap_rflush() and apr_file_close() but haven't work. In the 
examples I have founded in internet works but not for me. I read something 
about one timer in the http protocol .h file but I don't understand well for 
what is the timer and how to use it.

I could use apr_file_read() and ap_rputs() but I prefer to use ap_send_fd() so 
if anyone can give me some hint I'll be happy.

Here is the small code without the checks:

apr_file_open(&f,r->finfo.fname,APR_READ,APR_OS_DEFAULT,r->pool)
ap_send_fd (f, r, offset, r->finfo.size, &nbytes)
apr_file_close(f)
return OK;

Thank for your help.
-- 
Javier Vela Diago
Computer Science Student
GnuPG key ID: 52DD9977

Mime
View raw message