From: brong Date: Sat, 12 Jan 2002 09:57:20 +0000 (+0000) Subject: Add function sqimap_run_command which combines sending and receiving a X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=42a07ac1d5db307837d0b2af4ea1c0511cad0f5d Add function sqimap_run_command which combines sending and receiving a message, ready for changes to other code which uses it. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@2125 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/functions/imap_general.php b/functions/imap_general.php index 1c598fa9..10d6efe8 100755 --- a/functions/imap_general.php +++ b/functions/imap_general.php @@ -33,6 +33,17 @@ function sqimap_session_id() { return( $IMAPSessionID ); } +/****************************************************************************** +** Both send a command and accept the result from the command. This is +** to allow proper session number handling. +******************************************************************************/ + +function sqimap_run_command ($imap_stream, $query, $handle_errors, &$response, &$message) { + fputs ($imap_stream, sqimap_session_id() . $query . "\r\n"); + $read = sqimap_read_data ($imap_stream, sqimap_session_id(), $handle_errors, $response, $message); + return $read; +} + /****************************************************************************** ** Reads the output from the IMAP stream. If handle_errors is set to true,