Bug 3750 - Feature request: need socket-read function that reads until a newline
Feature request: need socket-read function that reads until a newline
Product: Samba 4.0
Classification: Unclassified
Component: Other
Other Linux
: P3 enhancement
: ---
Assigned To: Stefan Metzmacher
Depends on:
  Show dependency treegraph
Reported: 2006-05-03 15:38 UTC by Jelmer Vernooij
Modified: 2013-11-04 08:27 UTC (History)
2 users (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Jelmer Vernooij 2006-05-03 15:38:00 UTC
basically afdgets, but one that can work on sockets and probably hooks into the socket subsystem (maybe using libpacket?)
Comment 1 Matthias Dieter Wallnöfer 2008-06-02 14:41:39 UTC
Jelmer, do you need this function still?
Comment 2 Matthias Dieter Wallnöfer 2008-08-14 11:26:32 UTC
Mark this as "Feature request".
Comment 3 Matthias Dieter Wallnöfer 2009-08-07 11:16:53 UTC
Metze, is such a function realisable using your "tsocket" library?
Comment 4 Stefan Metzmacher 2009-08-20 03:06:46 UTC
Yes, should be trivial

For what do you need it?
Comment 5 Jelmer Vernooij 2009-10-01 07:13:37 UTC
IIRC I needed it to read lines from stdin easily. E.g. regpatch
Comment 6 Matthias Dieter Wallnöfer 2009-10-01 07:14:29 UTC
Change QA contact
Comment 7 Matthias Dieter Wallnöfer 2009-11-12 04:46:02 UTC
Metze, are you fine with implementing such a call (socket-read function that reads until a newline)?
Comment 8 Stefan Metzmacher 2009-11-12 04:59:08 UTC
Yes, would something like this work?

struct tstream_readline_context *
tstream_readline_create_context(TALLOC_CTX *mem_ctx, size_t tmp_buffer_size);

struct tevent_req *
tstream_readline_send(TALLOC_CTX *mem_ctx, struct tevent_context *ev,
                      struct tstream_context *stream,
                      struct tstream_readline_context *rl_ctx,
                      ssize_t max_len);
ssize_t tstream_readline_recv(struct tevent_req *req, int *perrno,
                              TALLOC_CTX *mem_ctx, const char **line);
Comment 9 Matthias Dieter Wallnöfer 2009-11-12 05:06:30 UTC
I would say that this is perfectly okay - but certainly we need also Jelmer's ACK.
Comment 10 Jelmer Vernooij 2009-11-24 05:42:44 UTC
Yeah, that would work for me. Thanks.
Comment 11 Matthias Dieter Wallnöfer 2009-12-17 03:06:53 UTC
Well, metze works on implementing the call - so put the bug in the ASSIGNED mode.
Comment 12 Matthias Dieter Wallnöfer 2010-11-21 03:56:46 UTC
Metze, do you have any plans to merge these changes? I think you've already a patch for this.