Cleaning up streams when connection aborted

From: Date: Mon, 18 Mar 2002 11:04:56 +0000
Subject: Cleaning up streams when connection aborted
Groups: php.dev 
Request: Send a blank email to php-dev+get-81434@lists.php.net to get a copy of this message
I've noticed a couple of places in the code where ZEND_REGISTER_RESOURCE is used to remember to cleanup streams, and then deletes the list entry when it has completed what it was doing. It's a nice idea, but it doesn't feel safe to me (probably because I'm not 100% aware of the way that PHP handles the connection aborting), since we can't guarantee that the stream allocation and resource registration is atomic (can we?). Should we consider removing the resource registration and instead have the streams code keep a list of all the persistent/non-persistent streams it has allocated, so that it can cleanup on request shutdown? When dealing with persistent streams I'd need to cleanup in the module shutdown, right? Also, I'd appreciate it if someone that knows about the persistent resource mechanism could bring me up to speed on what I should/should not being doing with persistent streams (currently only pfsockopened streams are persistent). Thanks! --Wez.

« previous php.dev (#81434) next »