unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Nic Ferrier <nferrier@tapsellferrier.co.uk>
Subject: non-blocking socket io: data limit on read?
Date: 01 Jul 2004 22:07:13 +0100	[thread overview]
Message-ID: <87y8m3l9mm.fsf@tapsellferrier.co.uk> (raw)
In-Reply-To: <87smk4zuvv.fsf@mail.jurta.org>

I have the beginnings of an nbio imap client. It sets up the socket
like this:

      (open-network-stream-nowait
	    "nbimap"
	    con-buffer
	    server 143
	    'nbimap-sentinel
	    'nbimap-filter)

The sentinel doesn't do anything special, it just sets states based
on the connection status.

The filter parses the data passed into it, and then inserts it into
the buffer.

But I am getting some read problems. Large data sets don't arrive in
full. I get a truncated form of the data. The bit I'm recieving is the
last part, so it's not that my filter is being called twice.

As an example I'm issuing an IMAP list command:
 
  0x LIST "" "*"

which returns all my folders, here's what goes over the socket
(sniffed):

T 127.0.0.1:143 -> 127.0.0.1:48929 [AP]
* LIST (\HasNoChildren) "." "INBOX.clients.earthport"..* LIST (\HasNoChildren) "." "INBOX.gnu.gdb"..* LIS
T (\HasNoChildren) "." "INBOX.Spam.test"..* LIST (\HasNoChildren) "." "INBOX.exim"..* LIST (\HasNoChildre
n) "." "INBOX.Spam.clever"..* LIST (\HasNoChildren) "." "INBOX.servlets.jcp"..* LIST (\HasNoChildren) "."
 "INBOX.gnu.libxmlxsl"..* LIST (\HasNoChildren) "." "INBOX.gnu.scheme"..* LIST (\HasNoChildren) "." "INBO
X.lispweb"..* LIST (\HasNoChildren) "." "INBOX.linux"..* LIST (\HasNoChildren) "." "INBOX.nic.policematte
r"..* LIST (\HasNoChildren) "." "INBOX.clients.sweetandmaxwell.java-tips"..* LIST (\HasNoChildren) "." "I
NBOX.gnu.emacs.nics-tip-of-the-day"..* LIST (\HasNoChildren) "." "INBOX.schemeunderground"..* LIST (\HasN
oChildren) "." "INBOX.debian.laptop"..* LIST (\HasNoChildren) "." "INBOX.tf.net"..* LIST (\HasNoChildren)
 "." "INBOX.gnu.servletapi"..* LIST (\HasNoChildren) "." "INBOX.gnu.gcj"..* LIST (\HasNoChildren) "." "IN
BOX.imapua-broken"..* LIST (\HasNoChildren) "." "INBOX.xsl"..* LIST (\HasNoChildren) "." "INBOX.wikipedia
"..* LIST (\HasChildren) "." "INBOX.tf"..* LIST (\HasChildren) "." "INBOX.servlets"..* LIST (\HasNoChildr
en) "." "INBOX.nic.jobs"..* LIST (\HasNoChildren) "." "INBOX.rest"..* LIST (\HasNoChildren) "." "INBOX.po
stgresql"..* LIST (\HasNoChildren) "." "INBOX.oracle"..* LIST (\HasNoChildren) "." "INBOX.nic.egg"..* LIS
T (\HasChildren) "." "INBOX.nic"..* LIST (\HasChildren) "." "INBOX.Spam"..* LIST (\HasNoChildren) "." "IN
BOX.java"..* LIST (\HasNoChildren) "." "INBOX.gnu.paperclips"..* LIST (\HasNoChildren) "." "INBOX.gnu.mai
lutils"..* LIST (\HasNoChildren) "." "INBOX.gnu.jaxp"..* LIST (\HasNoChildren) "." "INBOX.gnu.javamail"..
* LIST (\HasNoChildren) "." "INBOX.gnu.java"..* LIST (\HasNoChildren) "." "INBOX.gnu.gjdoc"..* LIST (\Has
Children) "." "INBOX.gnu.emacs"..* LIST (\HasNoChildren) "." "INBOX.gnu.cvs"..* LIST (\HasNoChildren) "."
 "INBOX.gnu.classpathx-administrivia"..* LIST (\HasChildren) "." "INBOX.gnu"..* LIST (\HasNoChildren) "."
 "INBOX.ferrier_me_uk"..* LIST (\HasChildren) "." "INBOX.debian"..* LIST (\HasNoChildren) "." "INBOX.clie
nts.withyham"..* LIST (\HasChildren) "." "INBOX.clients.sweetandmaxwell"..* LIST (\HasChildren) "." "INBO
X.clients"..* LIST (\HasNoChildren) "." "INBOX.articles"..* LIST (\HasNoChildren) "." "INBOX.affs"..* LIS
T (\HasNoChildren) "." "INBOX.Trash"..* LIST (\HasNoChildren) "." "INBOX.Sent"..* LIST (\Marked \HasChild
ren) "." "INBOX"..02 OK LIST completed...                                                                

But what I get in the data argument to the filter function is this:

  "BOX.debian\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.clients.withyham\"\n* LIST (\\HasChildren) \".\" \"INBOX.clients.sweetandmaxwell\"\n* LIST (\\HasChildren) \".\" \"INBOX.clients\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.articles\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.affs\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.Trash\"\n* LIST (\\HasNoChildren) \".\" \"INBOX.Sent\"\n* LIST (\\Marked \\HasChildren) \".\" \"INBOX\"\n02 OK LIST completed.\n"

Clearly truncated.

My Emacs version is:

   GNU Emacs 21.3.50.2 (i686-pc-linux-gnu, X toolkit)


It's pretty complicated code (process.c) so I don't want to have to
get into it unless I need to   /8->

Has anyone got any ideas?


-- 
Nic Ferrier
http://www.tapsellferrier.co.uk

  parent reply	other threads:[~2004-07-01 21:07 UTC|newest]

Thread overview: 135+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-28  1:26 terminal escapes in Info files? Karl Berry
2003-10-28 10:51 ` Alper Ersoy
2003-10-28 13:48   ` Oliver Scholz
2003-10-30 10:42     ` Alper Ersoy
2003-11-10 13:01       ` HTML as info format (was: terminal escapes in Info files?) Oliver Scholz
2003-11-17 13:29         ` HTML as info format Juri Linkov
2003-11-18  7:01           ` Richard Stallman
2003-11-18 14:54             ` Changes to Texinfo DTD [Was: Re: HTML as info format] Robert J. Chassell
2003-11-18 15:59               ` Changes to Texinfo DTD Oliver Scholz
2003-11-18 21:03                 ` Robert J. Chassell
2003-11-18 21:18                   ` Nic Ferrier
2003-11-19 12:38                     ` Robert J. Chassell
2003-11-19 13:18                       ` Nic Ferrier
2003-11-20 10:37                   ` Oliver Scholz
2003-11-20 16:55                     ` Robert J. Chassell
2003-11-20 18:19                       ` Oliver Scholz
2003-11-20 20:32                         ` Nic Ferrier
2003-11-20 22:05                           ` Oliver Scholz
2003-11-20 22:51                             ` Nic Ferrier
2003-11-21  2:13                             ` Robert J. Chassell
2003-11-21  8:49                               ` Nic Ferrier
2003-11-21  2:10                           ` Robert J. Chassell
2003-11-21  7:57                             ` Nic Ferrier
2003-11-24  7:57                               ` Juri Linkov
2003-11-24  9:32                                 ` Nic Ferrier
2003-11-22 21:19                           ` Richard Stallman
2003-11-22 21:41                             ` Nic Ferrier
2003-11-22 21:42                               ` Miles Bader
2003-11-22 21:56                                 ` Nic Ferrier
2003-11-24  7:55                                   ` Juri Linkov
2003-11-24  9:25                                     ` Why XSLT in Emacs Lisp? (was Re: Changes to Texinfo DTD) Nic Ferrier
2003-11-24 13:04                                       ` Why XSLT in Emacs Lisp? Alex Schroeder
2003-11-23 17:14                                 ` Changes to Texinfo DTD Robert J. Chassell
2003-11-24  7:54                                 ` Juri Linkov
2003-11-24 16:19                                   ` Luc Teirlinck
2003-11-24 22:32                                     ` Robert J. Chassell
2003-11-24 22:31                                       ` Miles Bader
2003-11-25  5:22                                     ` Juri Linkov
2003-11-25 16:48                                       ` Luc Teirlinck
2003-11-25 21:59                                         ` Juri Linkov
2003-11-25 23:32                                           ` Luc Teirlinck
2003-11-25 19:54                                       ` Luc Teirlinck
2003-11-25 21:48                                         ` Juri Linkov
2003-11-26  1:08                                           ` Luc Teirlinck
2003-12-02  6:42                                     ` Eli Zaretskii
2003-12-03  1:47                                       ` Luc Teirlinck
2003-12-03 16:18                                         ` Eli Zaretskii
2003-12-04  2:53                                           ` Luc Teirlinck
2003-12-04  7:58                                             ` Eli Zaretskii
2003-12-04  2:54                                           ` Luc Teirlinck
2003-12-04  8:04                                             ` Eli Zaretskii
2003-12-04  9:39                                               ` Oliver Scholz
2003-12-04 11:48                                                 ` Oliver Scholz
2003-12-04 15:35                                                 ` Eli Zaretskii
2003-12-04  8:19                                             ` Oliver Scholz
2003-12-04 13:49                                             ` Robert J. Chassell
2003-12-05  0:11                                             ` Richard Stallman
2003-12-05  9:49                                               ` Kim F. Storm
2003-12-06 16:11                                                 ` Alfred M. Szmidt
2003-12-06 17:11                                                   ` Eli Zaretskii
2003-12-09 16:47                                                     ` Alfred M. Szmidt
2003-12-10  7:25                                                       ` Eli Zaretskii
2003-12-04  3:35                                           ` Luc Teirlinck
2003-12-04  8:12                                             ` Eli Zaretskii
2003-11-22 23:59                               ` Stefan Monnier
2003-11-23  0:05                                 ` Nic Ferrier
2003-11-23 14:16                                   ` Oliver Scholz
2003-11-23 15:11                                     ` Nic Ferrier
2003-11-24 16:22                               ` Richard Stallman
2003-11-20 18:24                       ` Karl Eichwalder
2003-11-24 16:23                     ` Richard Stallman
2003-12-02  7:08           ` HTML as info format Eli Zaretskii
2003-12-01 10:38             ` Info enhancements Juri Linkov
2003-12-02  3:34               ` Luc Teirlinck
2003-12-02 10:54                 ` Juri Linkov
2003-12-02  4:43               ` Luc Teirlinck
2003-12-02 10:18               ` Info enhancements (was: Re: HTML as info format) Juri Linkov
2003-12-02 17:27                 ` Eli Zaretskii
2003-12-02 19:26                   ` Karl Berry
2003-12-03  5:38                     ` Info enhancements Juri Linkov
2003-12-03 13:27                       ` Karl Berry
2003-12-03 15:46                         ` Robert J. Chassell
2003-12-20  5:34                         ` Juri Linkov
2003-12-20 14:57                           ` Karl Berry
2003-12-03 17:16                     ` Info enhancements (was: Re: HTML as info format) Richard Stallman
2003-12-02 21:22               ` Info enhancements Reiner Steib
2003-12-03  3:54                 ` `s' (regex) search [was Re: Info enhancements] Harry Putnam
2003-12-03  5:47                   ` Eli Zaretskii
2003-12-03  9:42                     ` Harry Putnam
2003-12-03 11:31                       ` Eli Zaretskii
2003-12-03 11:56                         ` Harry Putnam
2003-12-03 16:27                           ` Eli Zaretskii
2003-12-03 19:13                             ` Harry Putnam
2003-12-04  8:34                               ` Eli Zaretskii
2003-12-03  5:04                 ` Info enhancements Juri Linkov
2004-09-01 16:42                   ` Reiner Steib
2004-09-01 20:55                     ` Juri Linkov
2004-09-02 19:02                       ` Richard Stallman
2003-12-03  0:33               ` Kim F. Storm
2003-12-03  6:43                 ` Juri Linkov
2003-12-12  2:08               ` Juri Linkov
2003-12-12 14:24                 ` Karl Berry
2003-12-12 17:14                   ` Eli Zaretskii
2003-12-12 19:23                     ` Stefan Monnier
2003-12-13 10:12                       ` Eli Zaretskii
2003-12-13 23:15                         ` Richard Stallman
2003-12-12 21:38                   ` Juri Linkov
2003-12-13 15:17                     ` Richard Stallman
2003-12-16  2:14                       ` Juri Linkov
2003-12-17  3:28                         ` Richard Stallman
2003-12-18  3:03                           ` Juri Linkov
2003-12-18 16:59                             ` Richard Stallman
2003-12-19 14:03                             ` Luc Teirlinck
2003-12-20  5:27                               ` Juri Linkov
2003-12-13 15:48                     ` Eli Zaretskii
2003-12-15  2:35                 ` Richard Stallman
2003-12-15  6:01                   ` Eli Zaretskii
2003-12-15 20:06                     ` Richard Stallman
2003-12-16  3:00                     ` Juri Linkov
2003-12-16 12:12                       ` Kim F. Storm
2003-12-17  3:28                         ` Richard Stallman
2003-12-17  3:28                       ` Richard Stallman
2004-07-01 21:07               ` Nic Ferrier [this message]
2003-10-28 16:19   ` terminal escapes in Info files? Stefan Monnier
2003-10-29 19:02     ` Richard Stallman
2003-10-29 19:47       ` David Kastrup
2003-10-29 21:43         ` Eli Zaretskii
2003-10-29 22:39           ` David Kastrup
2003-10-30  6:03             ` Eli Zaretskii
2003-10-30 18:00         ` Richard Stallman
2003-10-29 19:01   ` Richard Stallman
2003-10-29 19:45     ` Alper Ersoy
2003-10-29 19:42       ` Eli Zaretskii
2003-10-30 18:00       ` Richard Stallman
2003-10-29 19:02 ` Richard Stallman

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=87y8m3l9mm.fsf@tapsellferrier.co.uk \
    --to=nferrier@tapsellferrier.co.uk \
    /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).