Subject: | Dead code at Curl.XS |
There is a dead code at Curl.XS. I found it at 4.09 and it is also present at the latest stable release.
Could you please fix it or let me know if I miss anything?
1245 #if (LIBCURL_VERSION_NUM>=0x070a03)
1246 switch(option) {
1247 /* slist cases */
1248 case CURLSHOPT_SHARE:
1249 case CURLSHOPT_UNSHARE:
1250 if (option < CURLOPTTYPE_OBJECTPOINT) { /* An integer value: */
1251 RETVAL = curl_share_setopt(self->curlsh, option, (long)SvIV(value));
1252 } else { /* A char * value: */
1253 /* FIXME: Does curl really want NULL for empty strings? */
1254 STRLEN dummy;
1255 char *pv = SvPV(value, dummy);
1256 RETVAL = curl_share_setopt(self->curlsh, option, *pv ? pv : NULL);
1257 };
1258 break;
1259 };
1260 #else
1261 croak("curl_share_setopt not supported in your libcurl version");
1262 #endif
CURLSHOPT_SHARE = 1
CURLSHOPT_UNSHARE = 2
CURLOPTTYPE_OBJECTPOINT = 10000
At condition "option < 10000", the value of "option" must be between 1 and 2. So, execution cannot reach this statement "STRLEN dummy;" on line 1254.