Apache module sending a memory buffer to the client

Apache module sending a memory buffer to the client

Post by Erik Hofma » Thu, 21 Oct 1999 04:00:00



Hi,

I am writing an Apache request handler which creates a png image on the
fly using libgd and send a "image/png" using the following code:

r->content_type = "image/png";
ap_send_http_header(r);

now i compile the image and want to send it using:

ap_rwrite(imgptr, gd_size, r);

where imgptr is the pointer to the image in memory.

This seems to be wrong because the browser doesn't display the image (it
seems to recognise it as being an image but it gives a size of -1).
Is this the corect way or am i doing something wrong?

Regards,

Erik Hofman

 
 
 

Apache module sending a memory buffer to the client

Post by Erik Hofma » Thu, 21 Oct 1999 04:00:00


<shame>
I forgot to include libpng and libz ...
</shame>

Now things work beautifully ...
Thanks to the Apache team.

Erik


> Hi,

> I am writing an Apache request handler which creates a png image on the
> fly using libgd and send a "image/png" using the following code:

> r->content_type = "image/png";
> ap_send_http_header(r);

> now i compile the image and want to send it using:

> ap_rwrite(imgptr, gd_size, r);

> where imgptr is the pointer to the image in memory.

> This seems to be wrong because the browser doesn't display the image (it
> seems to recognise it as being an image but it gives a size of -1).
> Is this the corect way or am i doing something wrong?

> Regards,

> Erik Hofman


 
 
 

1. RedHat client sends DHCPDISCOVER, server hears and sends DHCPOFFER that doesn't reach client

Hi,
        I work in an office whose DHCP server is a FreeBSD 2.2.5 box, and I'm
trying to get DHCPcd to work on a RedHat 5.2 box. After much anguish,
I've been able to get to the point where the RedHat box sends out a
DHCPDISCOVER message (see figure 3 in rfc2131) with the client hardware
address that matches the ethernet adapter's just fine (SMC Ultra in an
ISA slot by the way), the FreeBSD box receives it and replies with a
DHCPOFFER message containing an IP address, but the RedHat box times out
complaining of "no DHCPOFFER messages." This is in an office with a mix
of Macintoshes, Windows (95, 98, NT), a sprinkling of FreeBSD and
OpenBSD, and one other RedHat box that I know of, all happily churning
along on DHCP.
        Any ideas would be much appreciated.

Best regards,
Grendel

2. How to prevent login from some hosts in SUN OS?

3. Sending XML data to Apache web server and capturing this sent data from the Apache server

4. Where to find a precompiled lynx 2.3??

5. Problems send messages between Apache modules...

6. X settings for Daimond Stlth 24VLB + Samsung Syncmaster 3n

7. Apache sending wrong cgi results to client

8. Diamond Stealth Graphics 64 (ARK) & 1028x768

9. send lost connection to client messages with Apache server

10. Apache/client slow to send/load graphics

11. apache module: send custom error text: how?

12. apache module - how to send a binary file