[zeromq-dev] Ruby zmq.send error
Conrad Steenberg
conrad.steenberg at gmail.com
Mon Aug 10 18:26:01 CEST 2009
Thanks :-)
On Mon, 2009-08-10 at 16:13 +0200, Tamara Kustarova wrote:
> Hi Conrad,
>
> the changes in librbzmq were put into git, so now it is possible to send
> a string containg zeros.
> It is in commit 123c269a921263cab56a9be7ef6aa86ab3380395
> <http://github.com/sustrik/zeromq1/commit/123c269a921263cab56a9be7ef6aa86ab3380395>.
> Thank you for helping us to fix it.
>
> Tamara
>
>
> Conrad Steenberg napsal(a):
> > Hi Tamara,
> >
> > The snippet below works fine here, thanks!
> >
> > This is on an up to date Fedora 11 system with ruby-1.8.6
> >
> > Cheers,
> > Conrad
> >
> > On Tue, 2009-08-04 at 16:59 +0200, Tamara Kustarova wrote:
> >
> >> Hi Conrad,
> >>
> >> we tried to send a string containg zeros with this patch:
> >>
> >> zmq::message_t msg ((size_t) RSTRING_LEN (data_));
> >> memcpy (msg.data (), (void*) RSTRING_PTR (data_),
> >> RSTRING_LEN (data_));
> >>
> >> and everything worked fine. The ruby version we used was 1.9.1
> >> Does it work on your box like this?
> >>
> >> Tamara
> >>
> >> Conrad Steenberg napsal(a):
> >>
> >>> On Fri, 2009-07-31 at 11:07 +0200, Martin Sustrik wrote:
> >>>
> >>>
> >>>> Hi Conrad,
> >>>>
> >>>>
> >>>>
> >>>>> The RSTRING() macro also checks for zeroes in the string, and throws the
> >>>>> same error.
> >>>>>
> >>>>>
> >>>> Hm. Looking at Ruby 1.8 header files (linux):
> >>>>
> >>>> #define R_CAST(st) (struct st*)
> >>>> #define RSTRING(obj) (R_CAST(RString)(obj))
> >>>>
> >>>> So RSTRING(x)->ptr should translate into ((struct RString*)(x))->ptr.
> >>>>
> >>>> There's no checking for zeroes there...
> >>>>
> >>>> How does the thing look like on your box?
> >>>>
> >>>>
> >>> It looks the same here.
> >>>
> >>> As a check could you try and send() a string containing zeroes with your
> >>> patch?
> >>>
> >>> Conrad
> >>>
> >>>
> >>>
> >>>> Martin
> >>>>
> >>>>
> >>>>
> >>> _______________________________________________
> >>> zeromq-dev mailing list
> >>> zeromq-dev at lists.zeromq.org
> >>> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
> >>>
> >>>
> >
> >
>
> _______________________________________________
> zeromq-dev mailing list
> zeromq-dev at lists.zeromq.org
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev
More information about the zeromq-dev
mailing list