unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: emacs-devel@gnu.org
Cc: Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug
Date: Thu, 14 Jan 2016 18:47:03 +0900	[thread overview]
Message-ID: <b4moacoh4rs.fsf@jpl.org> (raw)
In-Reply-To: E1aJOIj-0006HW-Cu@vcs.savannah.gnu.org

Hi,

On Wed, 13 Jan 2016 16:29:37 +0000, Paul Eggert <eggert@cs.ucla.edu> wrote:
> branch: emacs-25
> commit ed1b2de50ae87d8b2f9882be7576fbe5097df65b
> Author: Paul Eggert <eggert@cs.ucla.edu>
> Commit: Paul Eggert <eggert@cs.ucla.edu>

>     Fix NNTP NEWGROUPS off-by-a-few-hours bug

>     * lisp/gnus/nntp.el (nntp-request-newgroups): Format string
>     in Universal Time, since we’re telling the server “GMT”.
> ---
>  lisp/gnus/nntp.el |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

> diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
> index 0e10dfd..0006ef9 100644
> --- a/lisp/gnus/nntp.el
> +++ b/lisp/gnus/nntp.el
> @@ -1130,7 +1130,7 @@ command whose response triggered the error."
>         (prog1
>             (nntp-send-command
>              "^\\.\r?\n" "NEWGROUPS"
> -            (format-time-string "%y%m%d %H%M%S" time)
> +            (format-time-string "%y%m%d %H%M%S" time t)
>              "GMT")
>           (nntp-decode-text))))))

Is this really a fix?  In Japan (i.e., +0900) this doesn't seem
to pass the correct GMT date to a server:

(defun nntp-request-newgroups-test (date)
  (let* ((time (date-to-time date))
	 (ls (- (cadr time) (nth 8 (decode-time time)))))
    (cond ((< ls 0)
	   (setcar time (1- (car time)))
	   (setcar (cdr time) (+ ls 65536)))
	  ((>= ls 65536)
	   (setcar time (1+ (car time)))
	   (setcar (cdr time) (- ls 65536)))
	  (t
	   (setcar (cdr time) ls)))
    (format-time-string "%y%m%d %H%M%S" time t)))

(let ((date (message-make-date)))
  (list date
	(nntp-request-newgroups-test date)))
 => ("Thu, 14 Jan 2016 18:44:10 +0900" "160114 004410")

If removing the last `t', it returns:

 => ("Thu, 14 Jan 2016 18:44:18 +0900" "160114 094418")

See also `gnus-ask-server-for-new-groups'.

Regards,



       reply	other threads:[~2016-01-14  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160113162937.24105.71354@vcs.savannah.gnu.org>
     [not found] ` <E1aJOIj-0006HW-Cu@vcs.savannah.gnu.org>
2016-01-14  9:47   ` Katsumi Yamaoka [this message]
2016-01-14 10:15     ` emacs-25 ed1b2de: Fix NNTP NEWGROUPS off-by-a-few-hours bug Andreas Schwab
2016-01-14 11:26       ` Katsumi Yamaoka
2016-01-14 16:08         ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4moacoh4rs.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).