MEDIUM: chunks: make the chunk struct's fields match the buffer struct

Chunks are only a subset of a buffer (a non-wrapping version with no head
offset). Despite this we still carry a lot of duplicated code between
buffers and chunks. Replacing chunks with buffers would significantly
reduce the maintenance efforts. This first patch renames the chunk's
fields to match the name and types used by struct buffers, with the goal
of isolating the code changes from the declaration changes.

Most of the changes were made with spatch using this coccinelle script :

  @rule_d1@
  typedef chunk;
  struct chunk chunk;
  @@
  - chunk.str
  + chunk.area

  @rule_d2@
  typedef chunk;
  struct chunk chunk;
  @@
  - chunk.len
  + chunk.data

  @rule_i1@
  typedef chunk;
  struct chunk *chunk;
  @@
  - chunk->str
  + chunk->area

  @rule_i2@
  typedef chunk;
  struct chunk *chunk;
  @@
  - chunk->len
  + chunk->data

Some minor updates to 3 http functions had to be performed to take size_t
ints instead of ints in order to match the unsigned length here.
diff --git a/src/payload.c b/src/payload.c
index cf5b883..054168a 100644
--- a/src/payload.c
+++ b/src/payload.c
@@ -630,8 +630,8 @@
 
 			if (name_type == 0) { /* hostname */
 				smp->data.type = SMP_T_STR;
-				smp->data.u.str.str = (char *)data + 9;
-				smp->data.u.str.len = name_len;
+				smp->data.u.str.area = (char *)data + 9;
+				smp->data.u.str.data = name_len;
 				smp->flags = SMP_F_VOLATILE | SMP_F_CONST;
 				return 1;
 			}
@@ -714,8 +714,8 @@
 	}
 
 	/* data points to cookie value */
-	smp->data.u.str.str = (char *)data;
-	smp->data.u.str.len = 0;
+	smp->data.u.str.area = (char *)data;
+	smp->data.u.str.data = 0;
 
 	while (bleft > 0 && *data != '\r') {
 		data++;
@@ -728,7 +728,7 @@
 	if (data[0] != '\r' || data[1] != '\n')
 		goto not_cookie;
 
-	smp->data.u.str.len = (char *)data - smp->data.u.str.str;
+	smp->data.u.str.data = (char *)data - smp->data.u.str.area;
 	smp->flags = SMP_F_VOLATILE | SMP_F_CONST;
 	return 1;
 
@@ -750,7 +750,9 @@
 	if (!smp->strm)
 		return 0;
 
-	return fetch_rdp_cookie_name(smp->strm, smp, args ? args->data.str.str : NULL, args ? args->data.str.len : 0);
+	return fetch_rdp_cookie_name(smp->strm, smp,
+				     args ? args->data.str.area : NULL,
+				     args ? args->data.str.data : 0);
 }
 
 /* returns either 1 or 0 depending on whether an RDP cookie is found or not */
@@ -890,12 +892,13 @@
 		return 0;
 	}
 
-	if (arg[2].type == ARGT_STR && arg[2].data.str.len > 0) {
-		if (arg[2].data.str.str[0] == '+' || arg[2].data.str.str[0] == '-')
+	if (arg[2].type == ARGT_STR && arg[2].data.str.data > 0) {
+		if (arg[2].data.str.area[0] == '+' || arg[2].data.str.area[0] == '-')
 			relative = 1;
-		str = arg[2].data.str.str;
+		str = arg[2].data.str.area;
 		arg[2].type = ARGT_SINT;
-		arg[2].data.sint = read_int64(&str, str + arg[2].data.str.len);
+		arg[2].data.sint = read_int64(&str,
+					      str + arg[2].data.str.data);
 		if (*str != '\0') {
 			memprintf(err_msg, "payload offset2 is not a number");
 			return 0;
@@ -1087,7 +1090,7 @@
 {
 	unsigned int token;
 
-	if (arg[0].data.str.len != 4) {
+	if (arg[0].data.str.data != 4) {
 		memprintf(err_msg, "token name must be exactly 4 characters");
 		return 0;
 	}
@@ -1095,8 +1098,8 @@
 	/* convert the token name to an unsigned int (one byte per character,
 	 * big endian format).
 	 */
-	token = (arg[0].data.str.str[0] << 24) + (arg[0].data.str.str[1] << 16) +
-		(arg[0].data.str.str[2] << 8) + (arg[0].data.str.str[3] << 0);
+	token = (arg[0].data.str.area[0] << 24) + (arg[0].data.str.area[1] << 16) +
+		(arg[0].data.str.area[2] << 8) + (arg[0].data.str.area[3] << 0);
 
 	arg[0].type      = ARGT_SINT;
 	arg[0].data.sint = token;