CVS update: php3/functions

From: Date: Sun, 30 May 1999 14:18:57 +0000
Subject: CVS update: php3/functions
Groups: php.dev 
Request: Send a blank email to php-dev+get-6305@lists.php.net to get a copy of this message
Date: Sunday May 30, 1999 @ 10:18 Author: sas Update of /repository/php3/functions In directory php:/tmp/cvs-serv21854 Modified Files: fsock.c Log Message: We need a double linked list here or sharing this list for persistent and non-persistent sockets will not work, since we need to be able to remove single entries from arbitrary locations within the list. Index: php3/functions/fsock.c diff -u php3/functions/fsock.c:1.110 php3/functions/fsock.c:1.111 --- php3/functions/fsock.c:1.110 Fri May 28 11:41:26 1999 +++ php3/functions/fsock.c Sun May 30 10:18:56 1999 @@ -27,7 +27,7 @@ | Jim Winstead (jimw@php.net) | +----------------------------------------------------------------------+ */ -/* $Id: fsock.c,v 1.110 1999/05/28 15:41:26 sas Exp $ */ +/* $Id: fsock.c,v 1.111 1999/05/30 14:18:56 sas Exp $ */ #ifdef THREAD_SAFE #include "tls.h" #endif @@ -102,6 +102,7 @@ size_t readpos; size_t writepos; struct php3i_sockbuf *next; + struct php3i_sockbuf *prev; char eof; char persistent; char is_blocked; @@ -380,6 +381,8 @@ #define SOCK_DESTROY(sock) \ if(sock->readbuf) pefree(sock->readbuf, sock->persistent); \ + if(sock->prev) sock->prev->next = sock->next; \ + if(sock->next) sock->next->prev = sock->prev; \ if(sock == phpsockbuf) \ phpsockbuf = sock->next; \ pefree(sock, sock->persistent) @@ -425,7 +428,8 @@ sock = pecalloc(sizeof(*sock), 1, persistent); sock->socket = socket; - sock->next = phpsockbuf; + if((sock->next = phpsockbuf)) + phpsockbuf->prev = sock; sock->persistent = persistent; phpsockbuf = sock; -- PHP Development Mailing List http://www.php.net/ To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net For help: php-dev-help@lists.php.net

« previous php.dev (#6305) next »