~ubuntu-branches/ubuntu/wily/curl/wily

« back to all changes in this revision

Viewing changes to lib/ftp.c

  • Committer: Package Import Robot
  • Author(s): Gianfranco Costamagna
  • Date: 2014-07-25 12:03:28 UTC
  • mfrom: (3.4.49 sid)
  • Revision ID: package-import@ubuntu.com-20140725120328-pcipulguoki2iabo
Tags: 7.37.1-1ubuntu1
* Merge from Debian unstable (LP: #1348564). Remaining changes:
  - Drop dependencies not in main:
    + Build-Depends: Drop stunnel4 and libssh2-1-dev.
    + Drop libssh2-1-dev from binary package Depends.
  - Add new libcurl3-udeb package.
  - Add new curl-udeb package.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3164
3164
  *done = FALSE; /* default to not done yet */
3165
3165
 
3166
3166
  /* We always support persistent connections on ftp */
3167
 
  conn->bits.close = FALSE;
 
3167
  connkeep(conn, "FTP default");
3168
3168
 
3169
3169
  pp->response_time = RESP_TIMEOUT; /* set default response time-out */
3170
3170
  pp->statemach_act = ftp_statemach_act;
3248
3248
    ftpc->ctl_valid = FALSE;
3249
3249
    ftpc->cwdfail = TRUE; /* set this TRUE to prevent us to remember the
3250
3250
                             current path, as this connection is going */
3251
 
    conn->bits.close = TRUE; /* marked for closure */
 
3251
    connclose(conn, "FTP ended with bad error code");
3252
3252
    result = status;      /* use the already set error code */
3253
3253
    break;
3254
3254
  }
3272
3272
    if(!result)
3273
3273
      result = CURLE_OUT_OF_MEMORY;
3274
3274
    ftpc->ctl_valid = FALSE; /* mark control connection as bad */
3275
 
    conn->bits.close = TRUE; /* mark for connection closure */
 
3275
    connclose(conn, "FTP: out of memory!"); /* mark for connection closure */
3276
3276
    ftpc->prevpath = NULL; /* no path remembering */
3277
3277
  }
3278
3278
  else {
3315
3315
        failf(data, "Failure sending ABOR command: %s",
3316
3316
              curl_easy_strerror(result));
3317
3317
        ftpc->ctl_valid = FALSE; /* mark control connection as bad */
3318
 
        conn->bits.close = TRUE; /* mark for connection closure */
 
3318
        connclose(conn, "ABOR command failed"); /* connection closure */
3319
3319
      }
3320
3320
    }
3321
3321
 
3354
3354
    if(!nread && (CURLE_OPERATION_TIMEDOUT == result)) {
3355
3355
      failf(data, "control connection looks dead");
3356
3356
      ftpc->ctl_valid = FALSE; /* mark control connection as bad */
3357
 
      conn->bits.close = TRUE; /* mark for closure */
 
3357
      connclose(conn, "Timeout or similar in FTP DONE operation"); /* close */
3358
3358
    }
3359
3359
 
3360
3360
    if(result)
3364
3364
      /* we have just sent ABOR and there is no reliable way to check if it was
3365
3365
       * successful or not; we have to close the connection now */
3366
3366
      infof(data, "partial download completed, closing connection\n");
3367
 
      conn->bits.close = TRUE; /* mark for closure */
 
3367
      connclose(conn, "Partial download with no ability to check");
3368
3368
      return result;
3369
3369
    }
3370
3370
 
4133
4133
      failf(conn->data, "Failure sending QUIT command: %s",
4134
4134
            curl_easy_strerror(result));
4135
4135
      conn->proto.ftpc.ctl_valid = FALSE; /* mark control connection as bad */
4136
 
      conn->bits.close = TRUE; /* mark for connection closure */
 
4136
      connclose(conn, "QUIT command failed"); /* mark for connection closure */
4137
4137
      state(conn, FTP_STOP);
4138
4138
      return result;
4139
4139
    }