First, the type SMP_T_METH was not handled by smp_dup function. It was never
called with this kind of samples, so it's not really a problem. But, this could
be useful in future.
For all known HTTP methods (GET, POST...), there is no extra space allocated for
a sample of type SMP_T_METH. But for unkown methods, it uses a chunk. So, like
for strings, we duplicate data, using a trash chunk.
/* These type are not const. */
break;
+ case SMP_T_METH:
+ if (smp->data.u.meth.meth != HTTP_METH_OTHER)
+ break;
+ /* Fall through */
+
case SMP_T_STR:
trash = get_trash_chunk();
trash->len = smp->data.u.str.len;
memcpy(trash->str, smp->data.u.str.str, trash->len);
smp->data.u.str = *trash;
break;
+
default:
/* Other cases are unexpected. */
return 0;