Re: Proxy example in eagle book does not work

2000-02-03 Thread Jason Bodnar

 I'm running a mod_perl proxy module similar to the one in the book.  I'm
 curious
 why you say
 Keep-Alive is a problem?  Is your concern performance because of timeout
 settings, or something else?

I'm not exactly sure what the problem is, but when Keep-Alive is passed via LWP
images are very slow to load, often taking 20/30 secs per image. Without it
they load just fine.

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

I swear I'd forget my own head if it wasn't up my ass. -- Jason Bodnar



Re: Proxy example in eagle book does not work

2000-02-03 Thread Doug Kyle



Jason Bodnar wrote:

 On 19-Jan-00 Doug MacEachern wrote:
  On Fri, 14 Jan 2000, Jason Bodnar wrote:
 
  A line in the proxy example of the eagle book on page 380 does not seem to
  work
  (entirely):
 
  The line:
 
  $r-headers_in-do(sub {$request-header(@_);});
 
  what if you change that to:
 
   $r-headers_in-do(sub {$request-header(@_); 1});
 
  ?

 That sets all the headers including Connection which is a problem if it's
 Keep-Alive. It probably needs to be something like:

 $r-headers_in-do(sub {return 1 if $_[0] eq 'Connection';
 $request-header(@_); 1});

 ---
 Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

 That boy wouldn't know the difference between the Internet and a hair net. --
 Jason Bodnar

I'm running a mod_perl proxy module similar to the one in the book.  I'm curious
why you say
Keep-Alive is a problem?  Is your concern performance because of timeout
settings, or something else?

--
Doug Kyle - Information Systems
Grand Rapids Public Library
"During my service in the United States Congress, I took the initiative in
creating the Internet."
-- Al Gore




Re: Proxy example in eagle book does not work

2000-02-01 Thread Jason Bodnar

On 19-Jan-00 Doug MacEachern wrote:
 On Fri, 14 Jan 2000, Jason Bodnar wrote:
 
 A line in the proxy example of the eagle book on page 380 does not seem to
 work
 (entirely):
 
 The line:
 
 $r-headers_in-do(sub {$request-header(@_);});
 
 what if you change that to:
 
  $r-headers_in-do(sub {$request-header(@_); 1});
 
 ?

That sets all the headers including Connection which is a problem if it's
Keep-Alive. It probably needs to be something like:

$r-headers_in-do(sub {return 1 if $_[0] eq 'Connection';
$request-header(@_); 1});

---
Jason Bodnar + [EMAIL PROTECTED] + Tivoli Systems

That boy wouldn't know the difference between the Internet and a hair net. --
Jason Bodnar



RE: Proxy example in eagle book does not work

2000-01-19 Thread Doug MacEachern

On Wed, 19 Jan 2000, Jonas Nordström wrote:

 I had the same problem. What does the "1" mean? That the sub returns with a
 true value?

yes, from ch9:

=item do()

This method provides a way to iterate through an entire table item by
item.  Pass it a reference to a code subroutine to be called once for
each table entry.  The subroutine should accept two arguments
corresponding to the key and value respectively, and should return a
true value.  The routine can return a false value to terminate the
iteration prematurely.

This example dumps the contents of the Iheaders_in field to the
browser:

  $r-headers_in-do(sub {
 my($key, $value) = @_;
 $r-print("$key = $value\n");
 1;
  });

For another example of Ido(), see listing 7.12 from the previous
chapter, where we use it to transfer the incoming headers from
the incoming Apache request to an outgoing LWP IHTTP::Request
object.

---

which means, ch7's example is broken, or that $request-header returned a
true value when the example was written.  I suppose the ch7 example should
explictly return 1 regardless.



Re: Proxy example in eagle book does not work

2000-01-18 Thread Doug MacEachern

On Fri, 14 Jan 2000, Jason Bodnar wrote:

 A line in the proxy example of the eagle book on page 380 does not seem to work
 (entirely):
 
 The line:
 
 $r-headers_in-do(sub {$request-header(@_);});

what if you change that to:

 $r-headers_in-do(sub {$request-header(@_); 1});

?