How can I ...

Help
2007-07-30
2013-05-01
  • vicente_peris
    vicente_peris
    2007-07-30

    How can I say obexftp not to retry the connection if it fails???

     
    • vicente_peris
      vicente_peris
      2007-07-30

      I solved this now...
      Simply I've commented lines 270 and 276 from apps/obexftp.c and recompiled it:

      250: static int cli_connect_uuid(const char *uuid, int uuid_len)
      251: {
      252:         int retry;
      253:
      254:         if (cli == NULL) {
      255:
      256:                 /* Open */
      257:                 cli = obexftp_open (transport, NULL, info_cb, NULL);
      258:                 if(cli == NULL) {
      259:                         fprintf(stderr, "Error opening obexftp-client\n");
      260:                         exit(1);
      261:                         //return FALSE;
      262:                 }
      263:                 if (!use_conn) {
      264:                         cli->quirks &= ~OBEXFTP_CONN_HEADER;
      265:                 }
      266:                 if (!use_path) {
      267:                         cli->quirks &= ~OBEXFTP_SPLIT_SETPATH;
      268:                 }
      269:         }
      270:         // for (retry = 0; retry < 3; retry++) {
      271:
      272:                 /* Connect */
      273:                 if (obexftp_connect_src (cli, src_dev, device, channel, uuid, uuid_len) >= 0)
      274:                         return TRUE;
      275:                 fprintf(stderr, "Still trying to connect\n");
      276:         // }
      277:
      278:         obexftp_close(cli);
      279:         cli = NULL;
      280:         return FALSE;
      281: }

      I think that retrying and number of retries must be optionals, don't you think?
      I will try it and make a patch...

       
    • kkez
      kkez
      2007-08-31

      When you try to send a file via bluetooth (through the opush channel), if you answer "no" on the phone to the request to receive a file, the request pops up again for two times. It's rather annoying, so i don't think it should be default.

       
      • vicente_peris
        vicente_peris
        2007-09-03

        • kkez
          kkez
          2007-09-03

          Yes, i already modified the code as you posted, but i'd like to see what zany thinks about it.

           
          • kkez, your reasoning is sound. We should only retry if the device is unreachable, not if the request is denied. I'll change the code asap.

             
            • kkez
              kkez
              2007-09-03

              Thank you.