Fixed up ftp implementation for event queue arguemnt to NewConnection.

This commit is contained in:
warren%netscape.com 1999-04-16 18:18:38 +00:00
parent 640e419016
commit 0c8a62f098
4 changed files with 16 additions and 10 deletions

View File

@ -69,7 +69,9 @@ nsFtpProtocolConnection::QueryInterface(const nsIID& aIID, void** aInstancePtr)
}
nsresult
nsFtpProtocolConnection::Init(nsIUrl* url, nsISupports* eventSink) {
nsFtpProtocolConnection::Init(nsIUrl* url, nsISupports* eventSink,
PLEventQueue* eventQueue)
{
nsresult rv;
if (mConnected)
@ -80,6 +82,8 @@ nsFtpProtocolConnection::Init(nsIUrl* url, nsISupports* eventSink) {
rv = eventSink->QueryInterface(nsIFtpEventSink::GetIID(), (void**)&mEventSink);
mEventQueue = eventQueue;
return rv;
}
@ -107,7 +111,7 @@ nsFtpProtocolConnection::Resume(void) {
// establishes the connection and initiates the file transfer.
NS_IMETHODIMP
nsFtpProtocolConnection::Open(nsIUrl* url, nsISupports* eventSink) {
nsFtpProtocolConnection::Open(void) {
nsresult rv;
mState = FTP_CONNECT;

View File

@ -63,7 +63,7 @@ public:
NS_IMETHOD Resume(void);
// nsIProtocolConnection methods:
NS_IMETHOD Open(nsIUrl* url, nsISupports* eventSink);
NS_IMETHOD Open(void);
NS_IMETHOD GetContentType(char* *contentType);
NS_IMETHOD GetInputStream(nsIInputStream* *result);
NS_IMETHOD GetOutputStream(nsIOutputStream* *result);
@ -88,17 +88,18 @@ public:
nsFtpProtocolConnection();
virtual ~nsFtpProtocolConnection();
nsresult Init(nsIUrl* url, nsISupports* eventSink);
nsresult Init(nsIUrl* url, nsISupports* eventSink, PLEventQueue* eventQueue);
protected:
nsIUrl* mUrl;
nsIFtpEventSink* mEventSink;
PLEventQueue* mEventQueue;
PRInt32 mServerType;
PRBool mPasv;
PRBool mConnected;
FTP_STATE mState;
nsITransport* mCPipe; // the command channel
nsITransport* mDPipe; // the data channel
nsITransport* mCPipe; // the command channel
nsITransport* mDPipe; // the data channel
};
#endif /* nsFtpProtocolConnection_h___ */

View File

@ -96,14 +96,15 @@ nsFtpProtocolHandler::NewUrl(const char* aSpec,
NS_IMETHODIMP
nsFtpProtocolHandler::NewConnection(nsIUrl* url,
nsISupports* eventSink,
nsIProtocolConnection* *result)
nsISupports* eventSink,
PLEventQueue* eventQueue,
nsIProtocolConnection* *result)
{
nsresult rv;
nsFtpProtocolConnection* connection = new nsFtpProtocolConnection();
if (connection == nsnull)
return NS_ERROR_OUT_OF_MEMORY;
rv = connection->Init(url, eventSink);
rv = connection->Init(url, eventSink, eventQueue);
if (NS_FAILED(rv)) {
delete connection;
return rv;

View File

@ -41,6 +41,7 @@ public:
nsIUrl* *result);
NS_IMETHOD NewConnection(nsIUrl* url,
nsISupports* eventSink,
PLEventQueue* eventQueue,
nsIProtocolConnection* *result);
// nsFtpProtocolHandler methods:
@ -48,7 +49,6 @@ public:
virtual ~nsFtpProtocolHandler();
protected:
};
#endif /* nsFtpProtocolHandler_h___ */