all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: emacs-devel@gnu.org
Cc: gnutls-devel@gnu.org
Subject: Re: Testing the gnutls support
Date: Fri, 08 Oct 2010 08:45:58 -0500	[thread overview]
Message-ID: <87r5g0x0fd.fsf@lifelogs.com> (raw)
In-Reply-To: m3r5g11xyn.fsf@quimbies.gnus.org

On Thu, 07 Oct 2010 23:42:40 +0200 Lars Magne Ingebrigtsen <larsi@gnus.org> wrote: 

LMI> I've done some testing of the gnutls support, and it pretty consistently
LMI> seems to fail if I request a lot of data.

LMI> For instance, if I do a header retrieval in a Gmail IMAP group, I end up
LMI> with this:

LMI> * 19 FETCH (UID 45 RFC822.SIZE 215416 BODYSTRUCTURE ((("TEXT" [...] ("CREATION-DATE" "M
LMI> Process *nnimap*<1> connection broken by remote peer

LMI> That's after receiving 15496 characters.

LMI> So something isn't quite working as it should do...

LMI> This works, though:

LMI> (let ((process
LMI>        (open-gnutls-stream "http" (current-buffer)
LMI> 			   "www.google.com" "https")))
LMI>   (process-send-string process "GET / HTTP/1.0\r\nServer: www.google.com\r\n\r\n"))

LMI> It seems related to the length of the text we receive.  Are there any
LMI> buffers in the gnutls library that needs flushing or anything?  

Not that I'm aware of.  All the examples just read the data and there
are no "flush" functions in the API.  You can see how they prep a socket
in the examples, nothing unusual is going on:

http://www.gnu.org/software/gnutls/manual/html_node/Helper-function-for-TCP-connections.html

...and then the clients just use the gnutls_{read,write}() functions.

Can you check what gnutls_record_get_max_size() returns for you?  That's
negotiated.  Also is there an error in that session (if you turn up
logging)?

I don't think it's related to gnutls_record_set_max_size() because the
max size is 4K and you're getting errors around 16K.  But being so close
to 16K is very suspicious and indicates a buffer issue.  Does the error
happen on send, receive, or both?  Is there a 16K threshold or does that
number vary a lot?

emacs_gnutls_write() does "fsync (STDOUT_FILENO)" after each write.
This is a leftover from Simon's original patch:

  printf("wrote %d bytes\n", bytes_written);
  fsync(STDOUT_FILENO);

and I forgot to take it out.  Can you remove it?  I can't push that
commit currently, sorry.  If that turns out to be the trigger...

If not we can try playing with
gnutls_transport_set_{push,pull}_function() I guess.  But I can't see
why the default {send,recv}() call is inadequate.

Ted




  reply	other threads:[~2010-10-08 13:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-07 21:42 Testing the gnutls support Lars Magne Ingebrigtsen
2010-10-08 13:45 ` Ted Zlatanov [this message]
2010-10-09 13:18   ` Lars Magne Ingebrigtsen
2010-10-09 13:37     ` Eli Zaretskii
2010-10-09 13:56       ` Lars Magne Ingebrigtsen
2010-10-10  4:50         ` Ted Zlatanov
2010-10-10 15:26           ` Lars Magne Ingebrigtsen
2010-10-11 14:02             ` Ted Zlatanov
2010-10-11 16:25               ` Lars Magne Ingebrigtsen
2010-10-11 17:25                 ` Ted Zlatanov
2010-10-14 21:37                   ` Lars Magne Ingebrigtsen
2011-03-28 18:52           ` Ted Zlatanov
2011-03-28 19:08             ` Ted Zlatanov
2011-03-29 20:29             ` Lars Magne Ingebrigtsen
2011-04-01 14:35               ` Ted Zlatanov
2011-04-01 15:39                 ` Lars Magne Ingebrigtsen
2011-04-01 20:11                   ` Ted Zlatanov
2011-04-02 20:26                     ` Lars Magne Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=87r5g0x0fd.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=emacs-devel@gnu.org \
    --cc=gnutls-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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.