/[Search-Estraier]/trunk/Estraier.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/Estraier.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 38 by dpavlin, Thu Jan 5 22:27:03 2006 UTC revision 39 by dpavlin, Thu Jan 5 22:36:10 2006 UTC
# Line 689  sub new { Line 689  sub new {
689          };          };
690          bless($self, $class);          bless($self, $class);
691    
692            if (@_) {
693                    $self->{debug} = 1;
694                    warn "## Node debug on\n";
695            }
696    
697          $self ? return $self : return undef;          $self ? return $self : return undef;
698  }  }
699    
# Line 837  sub shuttle_url { Line 842  sub shuttle_url {
842                  return -1;                  return -1;
843          }          }
844    
845            warn "## headers:\n$headers\n" if ($self->{debug});
846    
847          print $sock $headers or          print $sock $headers or
848                  carp "can't send headers to network:\n$headers\n" and return -1;                  carp "can't send headers to network:\n$headers\n" and return -1;
849    
850          if ($reqbody) {          if ($reqbody) {
851                    warn "## request body:\n$headers\n" if ($self->{debug});
852                  print $sock $$reqbody or                  print $sock $$reqbody or
853                          carp "can't send request body to network:\n$$reqbody\n" and return -1;                          carp "can't send request body to network:\n$$reqbody\n" and return -1;
854          }          }
# Line 850  sub shuttle_url { Line 858  sub shuttle_url {
858          my ($schema, $res_status, undef) = split(/  */, $line, 3);          my ($schema, $res_status, undef) = split(/  */, $line, 3);
859          return if ($schema !~ /^HTTP/ || ! $res_status);          return if ($schema !~ /^HTTP/ || ! $res_status);
860    
861          $self->{status} = $res_status;          $status = $res_status;
862            warn "## response status: $res_status\n" if ($self->{debug});
863    
864          # skip rest of headers          # skip rest of headers
865          $line = <$sock>;          $line = <$sock>;
# Line 867  sub shuttle_url { Line 876  sub shuttle_url {
876                  $$resbody .= $buf if ($resbody);                  $$resbody .= $buf if ($resbody);
877          } while ($len);          } while ($len);
878    
879            
880            warn "## response body:\n$$resbody\n" if ($self->{debug});
881    
882          return $status;          return $status;
883  }  }
884    

Legend:
Removed from v.38  
changed lines
  Added in v.39

  ViewVC Help
Powered by ViewVC 1.1.26