home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / perl / do_httpx3.al < prev    next >
Encoding:
Text File  |  2003-11-16  |  1.4 KB  |  37 lines

  1. # NOTE: Derived from blib\lib\Net\SSLeay.pm.
  2. # Changes made here will be lost when autosplit is run again.
  3. # See AutoSplit.pm.
  4. package Net::SSLeay;
  5.  
  6. #line 2194 "blib\lib\Net\SSLeay.pm (autosplit into blib\lib\auto\Net\SSLeay\do_httpx3.al)"
  7. sub do_httpx3 {
  8.     my ($method, $usessl, $site, $port, $path, $headers,
  9.     $content, $mime_type, $crt_path, $key_path) = @_;
  10.     my ($response, $page, $h,$v);
  11.  
  12.     if ($content) {
  13.     $mime_type = "application/x-www-form-urlencoded" unless $mime_type;
  14.     my $len = blength($content);
  15.     $content = "Content-Type: $mime_type$CRLF"
  16.         . "Content-Length: $len$CRLF$CRLF$content";
  17.     } else {
  18.     $content = "$CRLF$CRLF";
  19.     }
  20.     my $req = "$method $path HTTP/1.0$CRLF"."Host: $site:$port$CRLF"
  21.       . (defined $headers ? $headers : '') . "Accept: */*$CRLF$content";    
  22.  
  23.     warn "do_httpx3($method,$usessl,$site:$port)" if $trace;
  24.     my ($http, $errs, $server_cert)
  25.     = httpx_cat($usessl, $site, $port, $req, $crt_path, $key_path);
  26.     return (undef, "HTTP/1.0 900 NET OR SSL ERROR$CRLF$CRLF$errs") if $errs;
  27.     
  28.     $http = '' if !defined $http;
  29.     ($headers, $page) = split /\s?\n\s?\n/, $http, 2;
  30.     warn "headers >$headers< page >>$page<< http >>>$http<<<" if $trace>1;
  31.     ($response, $headers) = split /\s?\n/, $headers, 2;
  32.     return ($page, $response, $headers, $server_cert);
  33. }
  34.  
  35. # end of Net::SSLeay::do_httpx3
  36. 1;
  37.