~mvo/apt/dep8

« back to all changes in this revision

Viewing changes to methods/http.cc

  • Committer: Arch Librarian
  • Date: 2004-09-20 16:56:32 UTC
  • Revision ID: Arch-1:apt@arch.ubuntu.com%apt--MAIN--0--patch-614
Join with aliencode
Author: jgg
Date: 2001-02-20 07:03:16 GMT
Join with aliencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// -*- mode: cpp; mode: fold -*-
2
2
// Description                                                          /*{{{*/
3
 
// $Id: http.cc,v 1.46 2000/05/28 04:33:59 jgg Exp $
 
3
// $Id: http.cc,v 1.47 2001/02/20 07:03:18 jgg Exp $
4
4
/* ######################################################################
5
5
 
6
6
   HTTP Aquire Method - This is the HTTP aquire method for APT.
285
285
   else
286
286
      Proxy = getenv("http_proxy");
287
287
   
288
 
   // Parse no_proxy, a , seperated list of hosts
 
288
   // Parse no_proxy, a , separated list of hosts
289
289
   if (getenv("no_proxy") != 0)
290
290
   {
291
291
      const char *Start = getenv("no_proxy");
376
376
         I = J;
377
377
      }
378
378
 
 
379
      // 100 Continue is a Nop...
 
380
      if (Result == 100)
 
381
         continue;
 
382
      
379
383
      // Tidy up the connection persistance state.
380
384
      if (Encoding == Closes && HaveContent == true)
381
385
         Persistent = false;
537
541
         else
538
542
            Persistent = true;
539
543
      }
540
 
      
 
544
 
541
545
      return true;
542
546
   }      
543
547
      
676
680
      Req += string("Proxy-Authorization: Basic ") + 
677
681
          Base64Encode(Proxy.User + ":" + Proxy.Password) + "\r\n";
678
682
 
 
683
   if (Uri.User.empty() == false || Uri.Password.empty() == false)
 
684
      Req += string("Authorization: Basic ") + 
 
685
          Base64Encode(Uri.User + ":" + Uri.Password) + "\r\n";
 
686
   
679
687
   Req += "User-Agent: Debian APT-HTTP/1.2\r\n\r\n";
680
688
   
681
689
   if (Debug == true)
1058
1066
         {
1059
1067
            _error->Error("Bad header Data");
1060
1068
            Fail(true);
 
1069
            RotateDNS();
1061
1070
            continue;
1062
1071
         }
1063
1072
         
1076
1085
               FailCounter = 0;
1077
1086
            }
1078
1087
            
 
1088
            RotateDNS();
1079
1089
            continue;
1080
1090
         }
1081
1091
      };
1093
1103
            // Run the data
1094
1104
            bool Result =  Server->RunData();
1095
1105
 
 
1106
            /* If the server is sending back sizeless responses then fill in
 
1107
               the size now */
 
1108
            if (Res.Size == 0)
 
1109
               Res.Size = File->Size();
 
1110
            
1096
1111
            // Close the file, destroy the FD object and timestamp it
1097
1112
            FailFd = -1;
1098
1113
            delete File;
1108
1123
            // Send status to APT
1109
1124
            if (Result == true)
1110
1125
            {
1111
 
               Res.MD5Sum = Server->In.MD5->Result();
 
1126
               Res.MD5Sum = Server->In.MD5->Result();          
1112
1127
               URIDone(Res);
1113
1128
            }
1114
1129
            else
1135
1150
         case 5:
1136
1151
         {
1137
1152
            Fail();
 
1153
            RotateDNS();
1138
1154
            Server->Close();
1139
1155
            break;
1140
1156
         }