* FtpOptions - change connection options * * returns 1 if successful, 0 on error */
| 547 | * returns 1 if successful, 0 on error |
| 548 | */ |
| 549 | GLOBALDEF int FtpOptions(int opt, long val, netbuf *nControl) { |
| 550 | int v, rv = 0; |
| 551 | switch (opt) { |
| 552 | case FTPLIB_CONNMODE: |
| 553 | v = (int) val; |
| 554 | if ((v == FTPLIB_PASSIVE) || (v == FTPLIB_PORT)) { |
| 555 | nControl->cmode = v; |
| 556 | rv = 1; |
| 557 | } |
| 558 | break; |
| 559 | case FTPLIB_CALLBACK: |
| 560 | nControl->idlecb = (FtpCallback) val; |
| 561 | rv = 1; |
| 562 | break; |
| 563 | case FTPLIB_IDLETIME: |
| 564 | v = (int) val; |
| 565 | rv = 1; |
| 566 | nControl->idletime.tv_sec = v / 1000; |
| 567 | nControl->idletime.tv_usec = (v % 1000) * 1000; |
| 568 | break; |
| 569 | case FTPLIB_CALLBACKARG: |
| 570 | rv = 1; |
| 571 | nControl->idlearg = (void *) val; |
| 572 | break; |
| 573 | case FTPLIB_CALLBACKBYTES: |
| 574 | rv = 1; |
| 575 | nControl->cbbytes = (int) val; |
| 576 | break; |
| 577 | } |
| 578 | return rv; |
| 579 | } |
| 580 | |
| 581 | /* |
| 582 | * FtpSendCmd - send a command and wait for expected response |
nothing calls this directly
no outgoing calls
no test coverage detected