httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@osf.org (Doug MacEachern)
Subject Re: apache1.1b2 & libperl.a
Date Wed, 01 May 1996 18:02:38 GMT
At 10:00 AM 5/1/96 -0700, new-httpd@hyperreal.com wrote:
>> 
>> >From a quick glance, it looked like I could just change these to 
>> fdopen(r->connection->client->fd_in, "r") and
>> fdopen(r->connection->client->fd, "w")
>> 
>> but, no such luck.
>
>	Please don't. Please try to make things follow the abstraction
>in Apache. It's in there so that we can later build a protocol API, so
>it would be great if the perl module could work with future SSL,
>HTTP-NG, byte-ranges, etc.
>	(I don't know how hard this would be, so if you must, you
>must.)

You're right, I wasn't thinking about those issues. I'm just trying to make
it compatible with existing perl CGI scripts.
The Perl->Apache xs glue is a direct interface to apache's abstraction.  So,
from perl you can bvputs, bwrite, etc.  Some Perl folks have talked about
tie()'d filehandles, which would be great to have here.  So, whenever a
script says:  
  print "something to the client\n";

what really happens is: 
  bputs("something to the client\n", r->connection->client);
  
I'll see if I can work some other Perl magic here, keeping the future in mind.  

Things sorta look like this right now:

   #using API
   $req = Apache->request;

   $host = $req->server->remote_host;
   $user = $req->connection->user;

   $req->set_content_type("text/html");
   $req->send_http_header;  

   $req->write_client ( #this really does a bvputs()
        "Hey you from $host! <br>\n",
        "I bet your name is $user. <br>\n",
        "Yippe! <hr>\n",
   );

   ###################
   #or setup standard CGI   

   %ENV = Apache->request->cgi_env;

   #this is what's broken right now   
   print (
	  "Content-type: text/html\n\n",
          "Hey you from $ENV{REMOTE_HOST}! <br>\n",
          "I bet your name is $ENV{REMOTE_USER}. <br>\n",
 	  "Yippe! <hr>\n",
   );


-Doug

>
>> 
>> Any clues before I dig deeper?
>> Keep in mind, no fork()'in pipe()s here 8-)
>> 
>> -Doug
>> 
>> >
>> >rst
>> >
>> >
>> 
>
>
>-- 
>Sameer Parekh					Voice:   510-601-9777x3
>Community ConneXion, Inc.			FAX:     510-601-9734
>The Internet Privacy Provider			Dialin:  510-658-6376
>http://www.c2.net/ (or login as "guest")		sameer@c2.net
>
>


Mime
View raw message