lkml.org 
[lkml]   [2015]   [May]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 4/4] netconsole: implement extended console support
From
From: Tejun Heo <tj@kernel.org>
Date: Mon, 11 May 2015 12:41:34 -0400

> + /* need to insert extra header fields, detect header and body */
> + header = msg;
> + body = memchr(msg, ';', msg_len);
> + if (WARN_ON_ONCE(!body))
> + return;
> +
> + header_len = body - header;
> + body_len = msg_len - header_len - 1;
> + body++;
> +
> + /*
> + * Transfer multiple chunks with the following extra header.
> + * "ncfrag=<byte-offset>/<total-bytes>"
> + */
> + memcpy(buf, header, header_len);
> +
> + while (offset < body_len) {
> + int this_header = header_len;
> + int this_chunk;
> +
> + this_header += scnprintf(buf + this_header,
> + sizeof(buf) - this_header,
> + ",ncfrag=%d/%d;", offset, body_len);
> +

Hmmm, do you intend ncfrag= to be amongst the other metadata in the first
fragment? The way I read the code above it's going to be:

<level>,<sequnum>,<timestamp>,<contflag>;,ncfrag=x/y;

If you intend to keep all the metadata, including the ncfrag bit,
together, you probably need to clip off the initial semicolon, so
that it looks like:

<level>,<sequnum>,<timestamp>,<contflag>,ncfrag=x/y;


\
 
 \ /
  Last update: 2015-05-11 20:01    [W:0.072 / U:0.712 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site