diff options
Diffstat (limited to 'libproto/nntp/nntp_mode_reader.c')
-rw-r--r-- | libproto/nntp/nntp_mode_reader.c | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/libproto/nntp/nntp_mode_reader.c b/libproto/nntp/nntp_mode_reader.c deleted file mode 100644 index 5b468382e..000000000 --- a/libproto/nntp/nntp_mode_reader.c +++ /dev/null @@ -1,66 +0,0 @@ -/* GNU Mailutils -- a suite of utilities for electronic mail - Copyright (C) 1999-2019 Free Software Foundation, Inc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 3 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library. If not, see - <http://www.gnu.org/licenses/>. */ - -#ifdef HAVE_CONFIG_H -# include <config.h> -#endif - -#include <string.h> -#include <errno.h> -#include <mailutils/sys/nntp.h> - -int -mu_nntp_mode_reader (mu_nntp_t nntp) -{ - int status; - - if (nntp == NULL) - return EINVAL; - - switch (nntp->state) - { - case MU_NNTP_NO_STATE: - status = mu_nntp_writeline (nntp, "MODE READER\r\n"); - MU_NNTP_CHECK_ERROR (nntp, status); - mu_nntp_debug_cmd (nntp); - nntp->state = MU_NNTP_MODE_READER; - - case MU_NNTP_MODE_READER: - status = mu_nntp_send (nntp); - MU_NNTP_CHECK_EAGAIN (nntp, status); - nntp->acknowledge = 0; - nntp->state = MU_NNTP_MODE_READER_ACK; - - case MU_NNTP_MODE_READER_ACK: - status = mu_nntp_response (nntp, NULL, 0, NULL); - MU_NNTP_CHECK_EAGAIN (nntp, status); - mu_nntp_debug_ack (nntp); - MU_NNTP_CHECK_CODE2(nntp, MU_NNTP_RESP_CODE_POSTING_ALLOWED, MU_NNTP_RESP_CODE_POSTING_PROHIBITED); - nntp->state = MU_NNTP_NO_STATE; - break; - - /* They must deal with the error first by reopening. */ - case MU_NNTP_ERROR: - status = ECANCELED; - break; - - default: - status = EINPROGRESS; - } - - return status; -} |