Olaf,

Tried implementing your patch but applying the patch fails with 4
rejects.
What version is it for? I used 1.3.0.

On Sat, Aug 01, 2009 at 10:52:59PM +0200, Olaf van der Spek wrote:
> To support
> httping http://google.com
> httping https://google.com
> httping google.com
> 
> --- main.c.orig 2009-08-01 22:28:44.000000000 +0200
> +++ main.c      2009-08-01 22:49:02.000000000 +0200
> @@ -325,13 +325,11 @@
>                                 return 1;
>                 }
>         }
> +       if (optind < argc)
> +               get = argv[optind];
> 
> -       last_error[0] = 0x00;
> 
> -#ifndef NO_SSL
> -       if (use_ssl && portnr == 80)
> -               portnr = 443;
> -#endif
> +       last_error[0] = 0x00;
> 
>         if (!get_instead_of_head && show_Bps)
>                 error_exit("-b/-B can only be used when also using -G\n");
> @@ -340,17 +338,18 @@
>         {
>                 char *slash, *colon;
>                 char *getcopy = mystrdup(get, "get request");
> -               char *http_string = "http://";;
> -               int http_string_len = 7;
> 
> -#ifndef NO_SSL
> -               if (use_ssl)
> +               if (strncasecmp(getcopy, "http://";, 7) == 0)
>                 {
> -                       http_string_len = 8;
> -                       http_string = "https://";;
> +                       getcopy += 7;
> +               }
> +               else if (strncasecmp(getcopy, "https://";, 8) == 0)
> +               {
> +                       getcopy += 8;
> +                       use_ssl = 1;
>                 }
> -#endif
> 
> +               /*
>                 if (strncasecmp(getcopy, http_string, http_string_len) != 0)
>                 {
>                         fprintf(stderr, "'%s' is a strange URL\n", getcopy);
> @@ -359,19 +358,20 @@
>                                 fprintf(stderr, "Did you forget to add
> the '-l' switch to the httping commandline?\n");
>                         return 2;
>                 }
> +               */
> 
> -               slash = strchr(&getcopy[http_string_len], '/');
> +               slash = strchr(getcopy, '/');
>                 if (slash)
>                         *slash = 0x00;
> 
> -               colon = strchr(&getcopy[http_string_len], ':');
> +               colon = strchr(getcopy, ':');
>                 if (colon)
>                 {
>                         *colon = 0x00;
>                         portnr = atoi(colon + 1);
>                 }
> 
> -               hostname = &getcopy[http_string_len];
> +               hostname = getcopy;
>         }
> 
>         if (hostname == NULL)
> @@ -380,6 +380,11 @@
>                 error_exit("No hostname/getrequest given\n");
>         }
> 
> +#ifndef NO_SSL
> +       if (use_ssl && portnr == 80)
> +               portnr = 443;
> +#endif
> +
>         if (get == NULL)
>         {
>  #ifndef NO_SSL
> 
> 


Folkert van Heusden

-- 
MultiTail na wan makriki wrokosani fu tan luku den logfile nanga san
den commando spiti puru. Piki puru spesrutu sani, wroko nanga difrenti
kroru, tya kon makandra, nanga wan lo moro.
http://www.vanheusden.com/multitail/
----------------------------------------------------------------------
Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to