• RSS
  • Twitter
  • FaceBook

Welcome to ISAserver.org

Forums | Register | Login | My Profile | Inbox | RSS RSS icon | My Subscription | My Forums | Address Book | Member List | Search | FAQ | Ticket List | Log Out

Problem with ftp content filter

Users viewing this topic: none

Logged in as: Guest
  Printable Version
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> Problem with ftp content filter Page: [1]
Login
Message << Older Topic   Newer Topic >>
Problem with ftp content filter - 23.Aug.2005 3:59:00 AM   
liuyuanxun_1983

 

Posts: 16
Joined: 17.Aug.2005
From: china
Status: offline
I am creating a ftp content filter to block the down load of txt file with 'helloworld' in it.Because I am a beginner,so first I want to creat a filter without any block function. I'm rewriting the exeblock in ISA 2004 SDK.I only change the code in ebscannerdatafilter. I delete the file writing function from it. And I send the content in iobuffer immediately in the CompleteAsyncIO function. But I find that the client still can't complete the connect to the ftp server. the code is as follow:

/////////////////////////////////////////////////////////////////////////////
// CEBScannerDataFilter::CompleteAsyncIO
//
// Implements IFWXIOCompletion::CompleteAsyncIO
//
// This methods is called when a Recv() call completed (all Recv calls
// are made with UserData = 0), or when a Send() call is completed
// (dwUserData != 0)
/////////////////////////////////////////////////////////////////////////////
HRESULT
CEBScannerDataFilter::CompleteAsyncIO(
BOOL fSuccess,
DWORD Win32ErrorCode,
IFWXIOBuffer *pIOBuffer,
UserContextType UserData,
PSOCKADDR From,
INT FromLen
)
{
UNREFERENCED_PARAMETER(FromLen);
UNREFERENCED_PARAMETER(From);
UNREFERENCED_PARAMETER(Win32ErrorCode);

DWORD DataLength = 0;
// HRESULT hr;
PBYTE pbBuffer = NULL;

if (pIOBuffer)
{
pIOBuffer->GetBufferAndSize(&pbBuffer, &DataLength);
}

if (UserData == 0)
{
if (!fSuccess)
{
_Abort();
return S_OK;
}
else
{
// here begins your scan process

if (DataLength == 0)
{
_AbortWithConstantMessage("226 tranfer complete!(Scanned by test filter!)");
return S_OK;
}

IFWXSocket *pIFWXSocketin = _GetInternalSocket();
if (pIFWXSocketin)
{
pIFWXSocketin->Send(pIOBuffer,NULL,1);
pIFWXSocketin->Release();
}

IFWXSocket *pIFWXSocketout = _GetExternalSocket();
if (pIFWXSocketout)
{
pIFWXSocketout->Recv(NULL, this, 0);
pIFWXSocketout->Release();
}
}
}
else
{
if (fSuccess)
{
IFWXSocket *pIFWXSocketout = _GetExternalSocket();
if (pIFWXSocketout)
{
pIFWXSocketout->Recv(NULL, this, 0);
pIFWXSocketout->Release();
}
}
else
{
_Abort();
}
}
return S_OK;
}
Post #: 1
RE: Problem with ftp content filter - 24.Aug.2005 6:50:00 AM   
liuyuanxun_1983

 

Posts: 16
Joined: 17.Aug.2005
From: china
Status: offline
When I installed this filter. The client can connect to the ftp server. If the client input 'dir',the client can get the file list from the ftp server. But the ftp.exe will stop here and the client can't input any other command.

(in reply to liuyuanxun_1983)
Post #: 2

Page:   [1] << Older Topic    Newer Topic >>
All Forums >> [ISA Server 2004 Misc.] >> ISA Server 2004 Programming >> Problem with ftp content filter Page: [1]
Jump to:

New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts