The Samba-Bugzilla – Bug 3750
Feature request: need socket-read function that reads until a newline
Last modified: 2013-11-04 08:27:30 UTC
basically afdgets, but one that can work on sockets and probably hooks into the socket subsystem (maybe using libpacket?)
Jelmer, do you need this function still?
Mark this as "Feature request".
Metze, is such a function realisable using your "tsocket" library?
Yes, should be trivial
For what do you need it?
IIRC I needed it to read lines from stdin easily. E.g. regpatch
Change QA contact
Metze, are you fine with implementing such a call (socket-read function that reads until a newline)?
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 tstream_readline_recv(struct tevent_req *req, int *perrno,
TALLOC_CTX *mem_ctx, const char **line);
I would say that this is perfectly okay - but certainly we need also Jelmer's ACK.
Yeah, that would work for me. Thanks.
Well, metze works on implementing the call - so put the bug in the ASSIGNED mode.
Metze, do you have any plans to merge these changes? I think you've already a patch for this.