Changeset 372
- Timestamp:
- 08/01/05 19:37:41 (5 years ago)
- Location:
- trunk
- Files:
-
- 2 modified
-
Makefile.PL (modified) (1 diff)
-
lib/Perlbal/ClientHTTPBase.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Makefile.PL
r370 r372 26 26 PREREQ_PM => { 27 27 'Danga::Socket' => '1.43', 28 'Sys::Syscall' => 0, 28 29 'BSD::Resource' => 0, 29 'Test::More' => 0,30 'File::Find' => 0,30 'Test::More' => 0, 31 'File::Find' => 0, 31 32 }, 32 33 dist => { -
trunk/lib/Perlbal/ClientHTTPBase.pm
r369 r372 11 11 # Copyright 2005, Six Apart, Ltd. 12 12 13 package main;14 15 # loading syscall.ph into package main in case some other module wants16 # to use it (like Danga::Socket, or whoever else)17 eval { require 'syscall.ph'; 1 } || eval { require 'sys/syscall.ph'; 1 };18 19 13 package Perlbal::ClientHTTPBase; 20 14 use strict; … … 22 16 no warnings qw(deprecated); 23 17 18 use Sys::Syscall; 24 19 use base "Perlbal::Socket"; 25 20 use HTTP::Date (); … … 44 39 use Errno qw( EPIPE ECONNRESET ); 45 40 use POSIX (); 46 47 our $SYS_sendfile = $ENV{NR_SENDFILE} || &::SYS_sendfile;48 41 49 42 # ghetto hard-coding. should let siteadmin define or something. … … 234 227 my $to_send = $self->{reproxy_file_size} - $self->{reproxy_file_offset}; 235 228 $self->tcp_cork(1) if $self->{reproxy_file_offset} == 0; 236 my $sent = syscall($SYS_sendfile, 237 $self->{fd}, 238 fileno($self->{reproxy_fh}), 239 0, # NULL offset means kernel moves offset 240 $to_send); 229 my $sent = Sys::Syscall::sendfile( 230 $self->{fd}, 231 fileno($self->{reproxy_fh}), 232 $to_send); 241 233 print "REPROXY Sent: $sent\n" if Perlbal::DEBUG >= 2; 242 234 if ($sent < 0) {
