// FtpServProt.bcpl - Server FTP protocol routines // Copyright Xerox Corporation 1979, 1980, 1982 // Last modified May 13, 1982 1:14 PM by Boggs get "FtpProt.decl" external [ // outgoing procedures FtpServProt; ServProtocolError // incoming procedures ServRetrieve; ServStore ServDelete; ServDirectory; ServRename ServStoreMail; ServRetrieveMail GetCommand; FTPM CloseBSPSocket; Free // incoming statics CtxRunning; defaultTimeout; sysZone ] //----------------------------------------------------------------------------------------- let FtpServProt(timeout) be //----------------------------------------------------------------------------------------- [ CtxRunning>>FtpCtx.serverFlag = true [ let mark = GetCommand(timeout)<>FtpCtx.Version) //----------------------------------------------------------------------------------------- and ServProtocolError() be //----------------------------------------------------------------------------------------- [ FTPM(markNo, 3, "Protocol Error - Aborting connection") ServClose(true) ] //----------------------------------------------------------------------------------------- and ServClose(abortIt) be //----------------------------------------------------------------------------------------- [ if CtxRunning>>FtpCtx.getCmdString then [ Free(sysZone, CtxRunning>>FtpCtx.getCmdString) CtxRunning>>FtpCtx.getCmdString = 0 ] if CtxRunning>>FtpCtx.connFlag then [ CtxRunning>>FtpCtx.connFlag = false CloseBSPSocket(CtxRunning>>FtpCtx.bspSoc, (abortIt? 0, defaultTimeout)) ] ]