10#if !defined(NO_SIGNALS) && (USE_SIO || !defined(SIGALRM) || !defined(SIGPIPE) || !defined(SIGINT))
23BrokenCtrl(
int UNUSED(signumIgnored))
29 longjmp(gBrokenCtrlJmp, 1);
183 for (
n = (
size_t)0, eofError = 0; ; ) {
190 }
else if (
c ==
'\r') {
198 }
else if (
c ==
EOF) {
200 }
else if (
c ==
'\0') {
207 }
else if (
c ==
'\n') {
212 PrintF(cip,
"TELNET protocol violation: raw LF.\n");
214 }
else if (
c ==
IAC) {
324 sj =
setjmp(gBrokenCtrlJmp);
345 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
354 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
369 Error(cip,
kDoPerror,
"Could not read reply from control connection");
408 continuation = (*
cp ==
'-');
418 while (continuation) {
424 Error(cip,
kDontPerror,
"Could not read reply from control connection -- timed out.\n");
439 Error(cip,
kDoPerror,
"Could not read reply from control connection");
465 if (rp->
code == 421) {
511 PrintF(cip,
"Cmd: %s\n",
"PASS xxxxxxxx");
549 PrintF(cip,
"Cmd: %s\n",
"PASS xxxxxxxx");
560 sj =
setjmp(gBrokenCtrlJmp);
876 PrintF(cip,
"Starting abort sequence.\n");
884 PrintF(cip,
"Could not send abort command.\n");
894 PrintF(cip,
"No response received to abort request.\n");
912 PrintF(cip,
"Invalid response to abort request.\n");
925 PrintF(cip,
"End abort.\n");
978BufferGets(
char *
buf,
size_t bufsize,
int inStream,
char *secondaryBuf,
char **secBufPtr,
char **secBufLimit,
size_t secBufSize)
992 for ( ;
dst < dstlim; ) {
993 if (
src >= (*secBufLimit)) {
1000 nr = (
int)
read(inStream, secondaryBuf, secBufSize);
1005 }
else if (
nr < 0) {
1010 (*secBufPtr) = secondaryBuf;
1011 (*secBufLimit) = secondaryBuf +
nr;
1013 if (
nr < (
int) secBufSize)
1033 if ((
len == 0) && (haveEof == 1))
int strcmp(const char *String1, const char *String2)
ACPI_SIZE strlen(const char *String)
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
#define STRNCPY(dst, src, n)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
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)
GLuint GLuint GLsizei GLenum type
GLenum GLuint GLenum GLsizei const GLchar * buf
GLenum GLuint GLsizei bufsize
_Check_return_opt_ _CRTIMP int __cdecl fgetc(_Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fputs(_In_z_ const char *_Str, _Inout_ FILE *_File)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
_Check_return_opt_ _CRTIMP int __cdecl fflush(_Inout_opt_ FILE *_File)
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
_Check_return_ int __cdecl atoi(_In_z_ const char *_Str)
#define SELECT_TYPE_ARG234
void InitLineList(LineListPtr list)
void DisposeLineListContents(LineListPtr list)
LinePtr AddLine(LineListPtr list, const char *buf1)
int FTPSetTransferType(const FTPCIPtr cip, int type)
void SendTelnetInterrupt(const FTPCIPtr cip)
void CloseDataConnection(const FTPCIPtr cip)
int OpenDataConnection(const FTPCIPtr cip, int mode)
int SetStartOffset(const FTPCIPtr cip, longest_int restartPt)
int SetLinger(const FTPCIPtr cip, int sockfd, int onoff)
int AcceptDataConnection(const FTPCIPtr cip)
void PrintF(const FTPCIPtr cip, const char *const fmt,...)
#define kClosedFileDescriptor
int SWrite(int, const char *const, size_t, int, int)
int SReadline(SReadlineInfo *, char *const, size_t)
int SWaitUntilReadyForReading(const int sfd, const int tlen)
int sigsetjmp(sigjmp_buf buf, int savesigs)
void siglongjmp(sigjmp_buf buf, int val)
int GetTelnetString(const FTPCIPtr, char *, size_t, FILE *, FILE *)
void FTPShutdownHost(const FTPCIPtr cip)
#define kFirewallNotInUse
struct Response * ResponsePtr
#define LIBNCFTP_USE_VAR(a)
#define kErrCouldNotStartDataTransfer
#define kErrSocketWriteFailed
#define kErrDataTransferFailed
#define kErrControlTimedOut
#define kErrInvalidReplyFromServer
#define kErrRemoteHostClosedConnection
int FTPCmd(const FTPCIPtr cip, const char *const cmdspec,...)
int FTPEndDataCmd(const FTPCIPtr cip, int didXfer)
void DoneWithResponse(const FTPCIPtr cip, ResponsePtr rp)
static void SaveLastResponse(const FTPCIPtr cip, ResponsePtr rp)
void PrintResponse(const FTPCIPtr cip, LineListPtr llp)
int BufferGets(char *buf, size_t bufsize, int inStream, char *secondaryBuf, char **secBufPtr, char **secBufLimit, size_t secBufSize)
void FTPAbortDataTransfer(const FTPCIPtr cip)
static int SendCommand(const FTPCIPtr cip, const char *cmdspec, va_list ap)
int FTPCmdNoResponse(const FTPCIPtr cip, const char *const cmdspec,...)
int WaitResponse(const FTPCIPtr cip, unsigned int sec)
int GetResponse(const FTPCIPtr cip, ResponsePtr rp)
void TraceResponse(const FTPCIPtr cip, ResponsePtr rp)
void ReInitResponse(const FTPCIPtr cip, ResponsePtr rp)
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,...)
ResponsePtr InitResponse(void)
_Check_return_ _CRTIMP int __cdecl __cdecl eof(_In_ int _FileHandle)
FTPPrintResponseProc printResponseProc
LineList lastFTPCmdResultLL
unsigned int abortTimeout
char lastFTPCmdResultStr[128]
void int int ULONGLONG int va_list * ap