git-commit-vandalism/compat/simple-ipc
Jeff Hostetler a3e2033e04 simple-ipc: preparations for supporting binary messages.
Add `command_len` argument to the Simple IPC API.

In my original Simple IPC API, I assumed that the request would always
be a null-terminated string of text characters.  The `command`
argument was just a `const char *`.

I found a caller that would like to pass a binary command to the
daemon, so I am amending the Simple IPC API to receive `const char
*command, size_t command_len` arguments.

I considered changing the `command` argument to be a `void *`, but the
IPC layer simply passes it to the pkt-line layer which takes a `const
char *`, so to avoid confusion I left it as is.

Note, the response side has always been a `struct strbuf` which
includes the buffer and length, so we already support returning a
binary answer.  (Yes, it feels a little weird returning a binary
buffer in a `strbuf`, but it works.)

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2021-09-20 08:57:58 -07:00
..
ipc-shared.c simple-ipc: correct ifdefs when NO_PTHREADS is defined 2021-05-21 07:55:00 +09:00
ipc-unix-socket.c simple-ipc: preparations for supporting binary messages. 2021-09-20 08:57:58 -07:00
ipc-win32.c simple-ipc: preparations for supporting binary messages. 2021-09-20 08:57:58 -07:00