From f944b154fcb0efbb777ee6a08c342ddfc149de87 Mon Sep 17 00:00:00 2001 From: ehouse Date: Wed, 14 Sep 2005 05:14:41 +0000 Subject: [PATCH] fix print_cookies to use iterator --- xwords4/relay/ctrl.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/xwords4/relay/ctrl.cpp b/xwords4/relay/ctrl.cpp index fe475db83..e2ae3eb1d 100644 --- a/xwords4/relay/ctrl.cpp +++ b/xwords4/relay/ctrl.cpp @@ -202,8 +202,18 @@ cmd_shutdown( int socket, const char** args ) static void print_cookies( int socket, const char* name ) { - CookieID id = CRefMgr::Get()->CookieIdForName( name ); - print_cookies( socket, id ); + CookieMapIterator iter = CRefMgr::Get()->GetCookieIterator(); + CookieID id; + + for ( id = iter.Next(); id != 0; id = iter.Next() ) { + SafeCref scr( id ); + if ( scr.IsValid() && scr.Name() == name ) { + string s; + scr.PrintCookieInfo( s ); + + print_to_sock( socket, s.c_str() ); + } + } } static void