From 98c4055bcba17cde81345947d61fa2faae108654 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 19 Dec 2008 16:10:08 +0100 Subject: Add some comments If it takes more than 10 seconds to understand the code you've written yourself less than a year ago, it's time for comments or refactoring. I couldn't find a way to refactor that cleanly, so add comments :-) --- source3/libsmb/async_smb.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3') diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c index 24e09e0107..3b7442a680 100644 --- a/source3/libsmb/async_smb.c +++ b/source3/libsmb/async_smb.c @@ -310,20 +310,42 @@ bool smb_splice_chain(char **poutbuf, uint8_t smb_command, ofs = old_size; + /* + * Push the chained request: + * + * wct field + */ + SCVAL(outbuf, ofs, wct); ofs += 1; + /* + * vwv array + */ + memcpy(outbuf + ofs, vwv, sizeof(uint16_t) * wct); ofs += sizeof(uint16_t) * wct; + /* + * bcc (byte count) + */ + SSVAL(outbuf, ofs, num_bytes + bytes_padding); ofs += sizeof(uint16_t); + /* + * padding + */ + if (bytes_padding != 0) { memset(outbuf + ofs, 0, bytes_padding); ofs += bytes_padding; } + /* + * The bytes field + */ + memcpy(outbuf + ofs, bytes, num_bytes); return true; -- cgit