> I'm more worried about whether or not I am on the right track with this > section of code layout. > > IF i wanted to allow a validated user to download one file at a time > from a certain folder sub handler { > # validate user first to see if they belong in this area > # check and see if this user already has an active connection and is > currently downloading a file by maintaining this information in some > way(memory cache, flat file, db)don't know or can you poll the > active connections on the server or would that take too more > resources
If you're concerned about speed, putting the data in MySQL, IPC::MM, or BerkeleyDB should be fast enough. Only MySQL in that list will work for multiple machines. > sub cleanup { > # remove active connections here b/c I won't be called until either > the file is through being sent or user terminated connection freeing > up services for this user to download another file A cleanup handler is the right place to do it, but you typically don't get interrupted when the user terminates the connection. Read more here:http://perl.apache.org/docs/1.0/guide/debug.html#Handling_the__User_pressed_Stop_button__case - Perrin -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html