Add some comments
authorVolker Lendecke <vl@samba.org>
Fri, 19 Dec 2008 15:10:08 +0000 (16:10 +0100)
committerVolker Lendecke <vl@samba.org>
Fri, 19 Dec 2008 15:13:26 +0000 (16:13 +0100)
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

index 24e09e010714022440aba8710dffdda5e288affc..3b7442a6803c9d2ea6b8054a5bc44ba748e8507a 100644 (file)
@@ -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;