- transport_info *ti = t->info;
- for (int i = 0; i < *ti->options_count; i++)
- {
- optionlist * op = &ti->options[i];
- if ((op->type & opt_mask) != opt_stringptr) continue;
- if (p == ( op->type & opt_public
- ? CS t
- : CS t->options_block
- )
- + op->v.offset)
- return US op->name;
- }
+ const transport_info * ti = t->info;
+
+ /* Check for a listptr match first */
+
+ for (optionlist * o = optionlist_transports; /* generic options */
+ o < optionlist_transports + optionlist_transports_size; o++)
+ if ( (o->type & opt_mask) == opt_stringptr
+ && listptr == CS t + o->v.offset)
+ return US o->name;
+
+ for (optionlist * o = ti->options; /* private options */
+ o < ti->options + *ti->options_count; o++)
+ if ( (o->type & opt_mask) == opt_stringptr
+ && listptr == CS t->options_block + o->v.offset)
+ return US o->name;
+
+ /* Check for a list addr match, unless null */
+
+ if (!list) continue;
+
+ for (optionlist * o = optionlist_transports; /* generic options */
+ o < optionlist_transports + optionlist_transports_size; o++)
+ if ( (o->type & opt_mask) == opt_stringptr
+ && list == * USS(CS t + o->v.offset))
+ if (name) return string_sprintf("DUP: %s %s vs. %s %s",
+ drname, name, t->name, o->name);
+ else { name = US o->name; drname = t->name; }
+
+ for (optionlist * o = ti->options; /* private options */
+ o < ti->options + *ti->options_count; o++)
+ if ( (o->type & opt_mask) == opt_stringptr
+ && list == * USS(CS t->options_block + o->v.offset))
+ if (name) return string_sprintf("DUP: %s %s vs. %s %s",
+ drname, name, t->name, o->name);
+ else { name = US o->name; drname = t->name; }