# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:47 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: AppleCSP
ProjectVersion: 16
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:51 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: AppleCSPDL
ProjectVersion: 15
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:52 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: AppleDL
ProjectVersion: 13
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:52 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: AppleX509CL
ProjectVersion: 3
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:53 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: AppleX509TP
ProjectVersion: 3
# Created and modified by checkpoint; do not edit
-# $Id: CVSVersionInfo.txt,v 1.23 2001/10/16 02:20:35 mb Exp $
-# $Name: Security-29 $
+# $Id: CVSVersionInfo.txt,v 1.22.4.2 2002/01/10 22:57:07 perry Exp $
+# $Name: Security-30~1 $
ProjectName: Security
-ProjectVersion: 29
+ProjectVersion: 30~1
// Only stream mode is supported.
// No EBCDIC support.
//
+#include <CoreServices/../Frameworks/CarbonCore.framework/Headers/MacErrors.h>
+
#include "ftp-protocol.h"
#include "netparameters.h"
-
namespace Security {
namespace Network {
printfe("RMD %s", mOperationPath.c_str());
state = directCommandSent;
return;
+ case removeFile:
+ printfe("DELE %s", mOperationPath.c_str());
+ state = directCommandSent;
+ return;
case genericCommand:
printfe("%s", mOperationPath.c_str());
state = directCommandSent;
mDataPath.connectionDone();
break;
case 452:
- fail(input, ENOSPC);
+ mDataPath.close();
+ state = idle;
+ fail(input, dskFulErr);
break;
default: // transfer failed
// (ignore any error in mDataPath - prefer diagnostics from remote)
void FTPProtocol::FTPTransfer::abort()
{
+ observe(Observer::aborting);
setError("aborted");
connectionAs<FTPConnection>().abort();
}
InetReply reply(errorDescription().c_str());
if (reply / 10 == 53) // 53x - authentication failure
return authorizationFailure;
- // when in doubt, blame the remote
+ if (errorDescription() == "aborted")
+ return abortedFailure;
+ // when in doubt, blame the remote
return remoteFailure;
}
case finished:
// FTP-specific operation codes
enum {
downloadDirectory = protocolSpecific, // get filename list (NLST)
- downloadListing, // get host-specific listing (LIST)
- makeDirectory, // make a directory (MKD)
- removeDirectory, // remove a directory (RMD)
- genericCommand // issue generic FTP command
+ downloadListing, // get host-specific listing (LIST)
+ makeDirectory, // make a directory (MKD)
+ removeDirectory, // remove a directory (RMD)
+ removeFile, // remove a file (DELE)
+ genericCommand // issue generic FTP command
};
private:
void HTTPProtocol::HTTPTransfer::abort()
{
+ observe(Observer::aborting);
setError("aborted");
connectionAs<HTTPConnection>().abort();
}
//
void Transfer::abort()
{
+ observe(Observer::aborting);
if (isDocked())
mConnection->retain(false); // indeterminate state; don't keep it
fail();
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:58 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: SecureTransport
ProjectVersion: 3
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:59 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: SecurityASN1
ProjectVersion: 6
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:14:04 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: SecuritySNACCRuntime
ProjectVersion: 6.1
fclose(mbox);
return errAuthorizationInternal;
}
+ fflush(mbox);
// make text representation of the temp-file descriptor
char mboxFdText[20];
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:14:00 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: SecurityServer
ProjectVersion: 17.1
# Created and modified by checkpoint; do not edit
# $Id: CVSVersionInfo.txt,v 1.1.1.1 2001/05/18 23:13:53 mb Exp $
-# $Name: Security-29 $
+# $Name: Security-30~1 $
ProjectName: cdsa
ProjectVersion: 21
}
}
+void BufferFifo::clearBuffer()
+{
+ while (!mBuffers.empty()) {
+ delete mBuffers.front();
+ mBuffers.pop();
+ }
+ mSize = 0;
+}
//
// This is the put function of a Sink. We store the data in at most two buffers:
//
void BufferFifo::consume(const void *data, size_t size)
{
+ mSize += size;
+
// step 1: fill the rearmost (partially filled) buffer
if (size > 0 && !mBuffers.empty()) {
Buffer *current = mBuffers.back();
// Sink implementation
void consume(const void *data, size_t size);
+ void clearBuffer();
private:
typedef queue< Buffer *, list<Buffer *> > BufferQueue;
//
class Sink {
public:
+ Sink() : mSize(0) {}
virtual ~Sink() { }
virtual void consume(const void *data, size_t length) = 0;
virtual void setSize(size_t expectedSize);
+ size_t getSize() {return mSize;}
+
+protected:
+ size_t mSize;
+
};
//
class MemorySink : public Sink {
public:
- MemorySink() : mBuffer(NULL), mSize(0), mMax(0) { }
+ MemorySink() : mBuffer(NULL), mMax(0) { }
~MemorySink() { free(mBuffer); }
void consume(const void *data, size_t length);
private:
void *mBuffer; // buffer base
- size_t mSize; // currently used
size_t mMax; // currently allocated
};