You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Vinod Mehra <vi...@beasys.com> on 1999/11/12 01:14:50 UTC

(Unknown)

Hi,

I have an apache module which gets an html page from somewhere upon a
request from the client
and then passes it back to the client.  The image references are not
getting resolved.

eg. my request is like:
    GET <my-tag>/acommand HTTP/1.1
This returns an html page with an image refernce : for
/servletimages/trans.gif

It logs error messages like: file doesn't exist - pointing to the local
file system.
    File does not exist: c:/program files/apache
group/apache/htdocs/servletimages/trans.gif

The corresponsing request it logs into access.log is :
    GET /servletimages/trans.gif HTTP/1.1

I was expecting the request to be : 
    GET /<my-tag>/servletimages/trans.gif HTTP/1.1

How to change this behaviour. Same logic works for NSAPI/ISAPI.

This is my how my code looks like when I send a html file with embedded
image references back 
to the client:

    set the r->header_out ...
    r->content_type = "some appropriate value; eg image/gif or image/jpeg";
    ap_send_http_header(r);
    char buf[BUF_SIZE];
    int x = 0;
    while ((x = uref->read(buf, BUF_SIZE)) > 0)
    {
	buf[x]='\0';
	ap_rwrite(buf, x, r);
	memset(buf, 0, BUF_SIZE);
    }

What am I missing here?

Thanks in advance,
Vinod.