]> git.saurik.com Git - apt.git/blobdiff - methods/http.cc
Fix segfault on really wide screens, #176052
[apt.git] / methods / http.cc
index 1c3f61caa63ec94e4a6ecd00210c88e646ae5b62..4521197edaa24ee654f413e64846c925e4454fb2 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: http.cc,v 1.52 2001/05/27 23:53:55 jgg Exp $
+// $Id: http.cc,v 1.54 2002/04/18 05:09:38 jgg Exp $
 /* ######################################################################
 
    HTTP Aquire Method - This is the HTTP aquire method for APT.
@@ -726,7 +726,11 @@ bool HttpMethod::Go(bool ToFile,ServerState *Srv)
    tv.tv_usec = 0;
    int Res = 0;
    if ((Res = select(MaxFd+1,&rfds,&wfds,0,&tv)) < 0)
+   {
+      if (errno == EINTR)
+        return true;
       return _error->Errno("select","Select failed");
+   }
    
    if (Res == 0)
    {
@@ -1138,6 +1142,9 @@ int HttpMethod::Loop()
         // Hard internal error, kill the connection and fail
         case 5:
         {
+           delete File;
+           File = 0;
+
            Fail();
            RotateDNS();
            Server->Close();
@@ -1175,3 +1182,5 @@ int main()
    
    return Mth.Loop();
 }
+
+