comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: Re: GNAT.Sockets Segfault in a task
Date: Sun, 03 Apr 2005 13:08:49 -0500
Date: 2005-04-03T13:08:49-05:00	[thread overview]
Message-ID: <7vedncmB7JKsrM3fRVn-iw@comcast.com> (raw)
In-Reply-To: pan.2005.04.03.15.17.15.869294@a2lf.org

> At httpd.adb, line 81, I've  "Message:String := String'Input(Channel);"
  Was the data written by a String'Output compiled by the same compiler
for the same kind of machine?  'Input expects to get first the bounds,
then the content, of the string.  The format of the bounds part is not
specified by the language, ie, it's compiler dependent.  Perhaps the
incoming data didn't contain any bounds and String'Input was interpreting
the first few characters as bounds, with disastrous result?
  If these are strings, are they from RFC 822 style data where string
termination is by CRLF?  In that case you need to do reads into a
buffer and concatenate/cut at CRLFs to make separate strings.  You
could make Channel of a child of Root_Stream_Type and write your
function RFC822_Input and "for String'Input use RFC822_Input;"

>Thanks. I resolved the problem with using STREAM :).
  Going to the low level suggests you know, independently, at least
the length of the string.  If the bounds are First and Last, you could:
declare
  Message : String(First .. Last);
begin
  String'Read(Channel, Message);
  ...



      reply	other threads:[~2005-04-03 18:08 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-03  9:16 GNAT.Sockets Segfault in a task Jean-Baptiste CAMPESATO
2005-04-03 12:28 ` Jeff C
2005-04-03 12:34   ` Jean-Baptiste CAMPESATO
2005-04-03 13:28     ` Pascal Obry
2005-04-03 13:35       ` Jean-Baptiste CAMPESATO
2005-04-03 15:17 ` Jean-Baptiste CAMPESATO
2005-04-03 18:08   ` tmoran [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox