Go Back   FlashFXP Forums > >

Programming Need help with C/C++/Delphi? Ask here and make us all laugh.

Closed Thread
 
Thread Tools Rate Thread Display Modes
Old 07-08-2003, 12:10 AM   #1
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default Modules...

Some of you might already know that I've been planning to add support for modules in various parts of code:
  • Events
  • User- and group-files
  • Cgis / Ftp & telnet commands
  • Cookies (there are two types of cookies: objects and variables)


This is my master plan for userfiles:

1. Application reads primary UID list from passwd
2. Initialization routines of all available modules are being called
3. WM_FETCHUID is sent to internal message window to fetch UID list
4. GetFirstUid followed by loop of GetNextUid for selected module is run - duplicate user names and user ids are removed.
5. OpenUserFile is called when userfile is needed and it's not already open.
6. SyncUserFile, LockUserFile require exclusive access to userfile. Call is supposed to block until lock is granted.
(Proper implementation of lock/sync does not block infinitely. If exclusive lock to file could not be achieved within perioid of time, backup routine should be called before unlock, if changes were made) UnlockUserFile is called to free lock. It's guaranteed by ioFTPD that these procedures are called in thread safe order (Sync/Lock will wait until previous Sync finishes - or unlock is being called for pending lock), and that write is never called before lock.
7. Resources are to be freed on CloseUserFile

x. DeleteUser should fail if userfile is in use
y. WM_UPDATEUID is sent to notify daemon of renamed user
z. ioFTPD handles memory allocation for userfile structure

....... I'm not sure, if that made any sense but that's how it'll be implemented (As an example, I'll propably convert current userfile algorithms to modules)

Suggested priority order:

1) Cookies - variables
2) Userfiles
3) Groupfiles
4) Cookies - objects
5) Events
6) Cgis / Ftp & telnet commands

.. back to bed
darkone is offline  
Old 07-08-2003, 10:10 AM   #2
thewarden
Senior Member
 
Join Date: Jan 2003
Posts: 194
Default

I have one concern.

If the call to open\close the user file is as I interpert your
meaning as a single USE - what about site(s) that have
multiple bw feeds calling to a single USER dir for 2+ sites
where each site as in my case can have the same SINGLE
user ONLINE at 4 sessions per site = 8 occourances in my
case for a single user...

Or did I misunderstand you?

TW
thewarden is offline  
Old 07-08-2003, 12:53 PM   #3
darkone
Disabled
FlashFXP Registered User
ioFTPD Administrator
 
darkone's Avatar
 
Join Date: Dec 2001
Posts: 2,230
Default

In such case, you need to synchronize access to userfiles somehow to ensure that two sites are not modifying file at the same time. (Afak most common databases provide option to lock rows/tables)
darkone is offline  
Closed Thread

Tags
called, ftp, lock, modules, userfile

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:23 AM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)