Go to the source code of this file.
|
ResponsePtr | InitResponse (void) |
|
void | TraceResponse (const FTPCIPtr cip, ResponsePtr rp) |
|
void | PrintResponse (const FTPCIPtr cip, LineListPtr llp) |
|
static void | SaveLastResponse (const FTPCIPtr cip, ResponsePtr rp) |
|
void | DoneWithResponse (const FTPCIPtr cip, ResponsePtr rp) |
|
void | ReInitResponse (const FTPCIPtr cip, ResponsePtr rp) |
|
int | GetResponse (const FTPCIPtr cip, ResponsePtr rp) |
|
static int | SendCommand (const FTPCIPtr cip, const char *cmdspec, va_list ap) |
|
int | FTPCmd (const FTPCIPtr cip, const char *const cmdspec,...) |
|
int | FTPCmdNoResponse (const FTPCIPtr cip, const char *const cmdspec,...) |
|
int | WaitResponse (const FTPCIPtr cip, unsigned int sec) |
|
int | RCmd (const FTPCIPtr cip, ResponsePtr rp, const char *cmdspec,...) |
|
int | FTPStartDataCmd (const FTPCIPtr cip, int netMode, int type, longest_int startPoint, const char *cmdspec,...) |
|
void | FTPAbortDataTransfer (const FTPCIPtr cip) |
|
int | FTPEndDataCmd (const FTPCIPtr cip, int didXfer) |
|
int | BufferGets (char *buf, size_t bufsize, int inStream, char *secondaryBuf, char **secBufPtr, char **secBufLimit, size_t secBufSize) |
|
◆ BufferGets()
Definition at line 978 of file rcmd.c.
979{
983 char *dstlim;
986 int haveEof = 0;
987
992 for ( ;
dst < dstlim; ) {
993 if (
src >= (*secBufLimit)) {
994
995
996
997
998
999
1000 nr = (
int)
read(inStream, secondaryBuf, secBufSize);
1002
1003 haveEof = 1;
1004 goto done;
1005 }
else if (
nr < 0) {
1006
1008 goto done;
1009 }
1010 (*secBufPtr) = secondaryBuf;
1011 (*secBufLimit) = secondaryBuf +
nr;
1013 if (
nr < (
int) secBufSize)
1015 }
1018 } else {
1021 goto done;
1022 }
1024 }
1025 }
1026
1027done:
1033 if ((
len == 0) && (haveEof == 1))
1034 return (-1);
1036}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLsizei bufsize
Referenced by FTPList(), and FTPListToMemory2().
◆ DoneWithResponse()
Definition at line 114 of file rcmd.c.
115{
116
117
118
119
125 }
128 else
132 }
133}
void DisposeLineListContents(LineListPtr list)
static void SaveLastResponse(const FTPCIPtr cip, ResponsePtr rp)
void TraceResponse(const FTPCIPtr cip, ResponsePtr rp)
FTPPrintResponseProc printResponseProc
Referenced by FTPAbortDataTransfer(), FTPChdirAndGetCWD(), FTPCloseHost(), FTPCmd(), FTPEndDataCmd(), FTPFileExistsStat(), FTPFileModificationTime(), FTPFileSize(), FTPGetCWD(), FTPLoginHost(), FTPMListOneFile(), FTPQueryFeatures(), FTPRemoteHelp(), FTPStartDataCmd(), FTPUtime(), nFTPChdirAndGetCWD(), OpenControlConnection(), Passive(), SendPort(), and SetStartOffset().
◆ FTPAbortDataTransfer()
Definition at line 870 of file rcmd.c.
871{
874
876 PrintF(cip,
"Starting abort sequence.\n");
878
881
884 PrintF(cip,
"Could not send abort command.\n");
885 return;
886 }
887
891
894 PrintF(cip,
"No response received to abort request.\n");
895 return;
896 }
897 }
898
904 return;
905 }
906
909
912 PrintF(cip,
"Invalid response to abort request.\n");
914 return;
915 }
917
918
919
920
921
922
925 PrintF(cip,
"End abort.\n");
926 }
927}
void SendTelnetInterrupt(const FTPCIPtr cip)
void CloseDataConnection(const FTPCIPtr cip)
int SetLinger(const FTPCIPtr cip, int sockfd, int onoff)
void PrintF(const FTPCIPtr cip, const char *const fmt,...)
#define kClosedFileDescriptor
void DoneWithResponse(const FTPCIPtr cip, ResponsePtr rp)
int FTPCmdNoResponse(const FTPCIPtr cip, const char *const cmdspec,...)
int WaitResponse(const FTPCIPtr cip, unsigned int sec)
int GetResponse(const FTPCIPtr cip, ResponsePtr rp)
ResponsePtr InitResponse(void)
unsigned int abortTimeout
Referenced by FTPCloseHost(), FTPGetOneF(), and FTPPutOneF().
◆ FTPCmd()
Definition at line 603 of file rcmd.c.
604{
608
613
620 }
621
623#ifndef NO_SIGNALS
626#endif
630#ifndef NO_SIGNALS
633#endif
635 }
636
637
639#ifndef NO_SIGNALS
642#endif
643
648}
int strcmp(const char *String1, const char *String2)
static int SendCommand(const FTPCIPtr cip, const char *cmdspec, va_list ap)
void int int ULONGLONG int va_list * ap
Referenced by DoOpen(), FTPChdir(), FTPChdir3(), FTPChmod(), FTPDelete(), FTPGetOneF(), FTPMkdir2(), FTPPutOneF(), FTPRename(), FTPRequestMlsOptions(), FTPRmdir(), FTPSetTransferType(), FTPSymlink(), FTPUmask(), QuoteCmd(), and SiteCmd().
◆ FTPCmdNoResponse()
Definition at line 656 of file rcmd.c.
657{
659
664
666#ifndef NO_SIGNALS
669#endif
671#ifndef NO_SIGNALS
674#endif
676
678}
Referenced by FTPAbortDataTransfer().
◆ FTPEndDataCmd()
◆ FTPStartDataCmd()
Definition at line 763 of file rcmd.c.
764{
767 int respCode;
769
774
778
779
781
782
783
784
785
786
787
788
789
790
791
792
794 goto done;
795
796
800 }
802
803
804
805
806
808#ifndef NO_SIGNALS
811#endif
815#ifndef NO_SIGNALS
818#endif
819 goto done;
820 }
821
822
823
824
825
826
827
828
834 goto done;
835 }
837#ifndef NO_SIGNALS
840#endif
841
843 goto done;
846
847 if (respCode > 2) {
850 goto done;
851 }
852
853
854
855
858 goto done;
860
861done:
864}
GLuint GLuint GLsizei GLenum type
int FTPSetTransferType(const FTPCIPtr cip, int type)
int OpenDataConnection(const FTPCIPtr cip, int mode)
int SetStartOffset(const FTPCIPtr cip, longest_int restartPt)
int AcceptDataConnection(const FTPCIPtr cip)
#define kErrCouldNotStartDataTransfer
int FTPEndDataCmd(const FTPCIPtr cip, int didXfer)
Referenced by FTPGetOneF(), FTPList(), FTPListToMemory2(), and FTPPutOneF().
◆ GetResponse()
Definition at line 287 of file rcmd.c.
288{
290 int eofError;
293 int continuation;
295#ifdef NO_SIGNALS
297#else
299 int sj;
300#endif
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315#ifdef NO_SIGNALS
316 vcip = cip;
317#else
319 vcip = cip;
320
321#ifdef HAVE_SIGSETJMP
323#else
324 sj =
setjmp(gBrokenCtrlJmp);
325#endif
326
327 if (sj != 0) {
332 }
333#endif
334
335#ifdef NO_SIGNALS
337 eofError = 0;
339
340
341
342
344
345 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
349 }
350 }
353
354 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
359
360 eofError = 1;
368
369 Error(cip,
kDoPerror,
"Could not read reply from control connection");
373 }
374
377
378#else
379
381
384 if (eofError < 0) {
385
393 }
394 }
395#endif
396
400#ifndef NO_SIGNALS
402#endif
404 }
405
408 continuation = (*
cp ==
'-');
413 if (eofError < 0) {
414
416 }
417
418 while (continuation) {
419
420#ifdef NO_SIGNALS
423
424 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
429
430 eofError = 1;
438
439 Error(cip,
kDoPerror,
"Could not read reply from control connection");
443 }
444
447#else
449 if (eofError < 0) {
450
452 continuation = 0;
453 }
454#endif
459 continuation = 0;
461 }
463 }
464
465 if (rp->
code == 421) {
466
467
468
469
470
475#ifndef NO_SIGNALS
477#endif
479 }
480
481#ifndef NO_SIGNALS
483#endif
485}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define STRNCPY(dst, src, n)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
LinePtr AddLine(LineListPtr list, const char *buf1)
int SReadline(SReadlineInfo *, char *const, size_t)
int SWaitUntilReadyForReading(const int sfd, const int tlen)
int sigsetjmp(sigjmp_buf buf, int savesigs)
int GetTelnetString(const FTPCIPtr, char *, size_t, FILE *, FILE *)
void FTPShutdownHost(const FTPCIPtr cip)
#define kErrControlTimedOut
#define kErrInvalidReplyFromServer
#define kErrRemoteHostClosedConnection
Referenced by FTPAbortDataTransfer(), FTPCmd(), FTPEndDataCmd(), FTPStartDataCmd(), OpenControlConnection(), and RCmd().
◆ InitResponse()
Definition at line 38 of file rcmd.c.
39{
41
45 return (rp);
46}
void InitLineList(LineListPtr list)
struct Response * ResponsePtr
Referenced by FTPAbortDataTransfer(), FTPChdirAndGetCWD(), FTPCloseHost(), FTPCmd(), FTPEndDataCmd(), FTPFileExistsStat(), FTPFileModificationTime(), FTPFileSize(), FTPGetCWD(), FTPLoginHost(), FTPMListOneFile(), FTPQueryFeatures(), FTPRemoteHelp(), FTPStartDataCmd(), FTPUtime(), nFTPChdirAndGetCWD(), OpenControlConnection(), Passive(), SendPort(), and SetStartOffset().
◆ PrintResponse()
◆ RCmd()
Definition at line 718 of file rcmd.c.
719{
722
727
729#ifndef NO_SIGNALS
732#endif
736#ifndef NO_SIGNALS
739#endif
741 }
742
743
745#ifndef NO_SIGNALS
748#endif
749
753}
Referenced by FTPChdirAndGetCWD(), FTPCloseHost(), FTPFileExistsStat(), FTPFileModificationTime(), FTPFileSize(), FTPGetCWD(), FTPLoginHost(), FTPMListOneFile(), FTPQueryFeatures(), FTPRemoteHelp(), FTPUtime(), nFTPChdirAndGetCWD(), Passive(), SendPort(), and SetStartOffset().
◆ ReInitResponse()
◆ SaveLastResponse()
◆ SendCommand()
Definition at line 496 of file rcmd.c.
497{
500
502#ifdef HAVE_VSNPRINTF
505#else
507#endif
510 else
511 PrintF(cip,
"Cmd: %s\n",
"PASS xxxxxxxx");
515
517
522 }
524 }
526}
ACPI_SIZE strlen(const char *String)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
int SWrite(int, const char *const, size_t, int, int)
#define kFirewallNotInUse
#define kErrSocketWriteFailed
Referenced by FTPCmd(), FTPCmdNoResponse(), FTPStartDataCmd(), and RCmd().
◆ TraceResponse()
◆ WaitResponse()
Definition at line 684 of file rcmd.c.
685{
690
691#ifdef NO_SIGNALS
693#else
695 return (-1);
697#endif
699 return (-1);
702 tv.tv_sec = (
unsigned long) sec;
703 tv.tv_usec = 0;
706}
INT WSAAPI select(IN INT s, IN OUT LPFD_SET readfds, IN OUT LPFD_SET writefds, IN OUT LPFD_SET exceptfds, IN CONST struct timeval *timeout)
#define SELECT_TYPE_ARG234
Referenced by FTPAbortDataTransfer().