Loading ...
Sorry, an error occurred while loading the content.

Re: dkftpbench binary transfers patch

Expand Messages
  • Dan Kegel
    ... Thanks, Ian! - Dan
    Message 1 of 1 , Apr 26, 2002
    • 0 Attachment
      Ian Willis wrote:
      > The ChangeLog for dkftpbench mentions that the transfer type still defaults
      > to ascii. Included below is a patch (diffs vs dkftpbench-0.42) which changes
      > the transfer type to image so you get binary transfers and thus a more
      > realistic test of an FTP server.

      Thanks, Ian!
      - Dan

      >
      > --- ftp_client_proto.h.00 Fri Apr 26 17:33:21 2002
      > +++ ftp_client_proto.h Fri Apr 26 17:37:37 2002
      > @@ -72,6 +72,7 @@
      > FCPS_USER, // waiting for response to USER
      > FCPS_PASS, // waiting for response to PASS
      > FCPS_IDLE, // central logged-in state, waiting for user
      > + FCPS_TYPE, // waiting for response to TYPE
      > FCPS_CWD, // waiting for response to CWD or CDUP
      > FCPS_SIZE, // waiting for response to SIZE
      > FCPS_PORT, // waiting for response to PORT
      > --- ftp_client_proto.cc.00 Fri Apr 26 17:31:39 2002
      > +++ ftp_client_proto.cc Fri Apr 26 17:32:37 2002
      > @@ -194,7 +194,8 @@
      > case FCPS_USER:
      > if ((status >= 200) && (status < 300)) {
      > DPRINT(("ftp_client_proto_t::giveInput: no password needed\n"));
      > - SETSTATE(FCPS_IDLE);
      > + m_obuflen = sprintf(m_obuf, "TYPE I\r\n");
      > + SETSTATE(FCPS_TYPE);
      > } else if ((status >= 300) && (status < 400)) {
      > /* Send the password. Actually, this could have been
      > * queued at the same time as the connect and the USER,
      > @@ -211,9 +212,20 @@
      > case FCPS_PASS:
      > if ((status >= 200) && (status < 300)) {
      > DPRINT(("ftp_client_proto_t::giveInput::PASS ok, %s\n", ibuf));
      > - SETSTATE(FCPS_IDLE);
      > + m_obuflen = sprintf(m_obuf, "TYPE I\r\n");
      > + SETSTATE(FCPS_TYPE);
      > } else {
      > DPRINT(("ftp_client_proto_t::giveInput::PASS failed, %s\n", ibuf));
      > + SETSTATE(FCPS_INIT);
      > + }
      > + break;
      > +
      > + case FCPS_TYPE:
      > + if ((status >= 200) && (status < 300)) {
      > + DPRINT(("ftp_client_proto_t::giveInput::TYPE ok, %s\n", ibuf));
      > + SETSTATE(FCPS_IDLE);
      > + } else {
      > + DPRINT(("ftp_client_proto_t::giveInput::TYPE failed, %s\n", ibuf));
      > SETSTATE(FCPS_INIT);
      > }
      > break;
    Your message has been successfully submitted and would be delivered to recipients shortly.