Hi Alban,

On Wed, Aug 17, 2011 at 04:41:38PM +0100, Alban Crequy wrote:
> @@ -77,12 +77,12 @@ static char **extract_result(const char *str)
>       result[0] = NULL;
>       result[1] = NULL;
>  
> -     if (strcmp(str, "DIRECT") == 0) {
> +     if (strcasecmp(str, "DIRECT") == 0) {
>               result[0] = strdup("direct://");
>               return result;
>       }
>  
> -     if (strncmp(str, "PROXY ", 6) == 0) {
> +     if (strncasecmp(str, "PROXY ", 6) == 0) {
So those 2 changes are not related to this patch. Moreover, why would we want
to be case-insensitive now ?

> +     if (strncasecmp(str, "SOCKS ", 6) == 0) {
> +             int len = strlen(str + 6) + 9;
> +             result[0] = malloc(len);
> +             if (result[0] != NULL)
> +                     sprintf(result[0], "socks://%s", str + 6);
> +             return result;
> +     }
> +
> +     if (strncasecmp(str, "SOCKS4 ", 7) == 0) {
> +             int len = strlen(str + 7) + 10;
> +             result[0] = malloc(len);
> +             if (result[0] != NULL)
> +                     sprintf(result[0], "socks4://%s", str + 7);
> +             return result;
> +     }
> +
> +     if (strncasecmp(str, "SOCKS5 ", 7) == 0) {
> +             int len = strlen(str + 7) + 10;
> +             result[0] = malloc(len);
> +             if (result[0] != NULL)
> +                     sprintf(result[0], "socks5://%s", str + 7);
> +             return result;
> +     }
> +
> +     if (strncasecmp(str, "SOCKS4a ", 8) == 0) {
> +             int len = strlen(str + 8) + 11;
> +             result[0] = malloc(len);
> +             if (result[0] != NULL)
> +                     sprintf(result[0], "socks4a://%s", str + 8);
> +             return result;
> +     }
> +
All those look good, except that the same case sensitivity question applies
here.

Cheers,
Samuel.

-- 
Intel Open Source Technology Centre
http://oss.intel.com/
_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to