[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    [BusyBox] (no subject)
From:       Marc Victor Carvalho Cabadas <bac () oops ! com ! br>
Date:       2004-07-30 18:00:28
Message-ID: 1091210428.410a8cbc733aa () ssl ! oops ! com ! br
[Download RAW message or body]

This message is in MIME format.


based in the archive http://linuxap.ksmith.com/archive/httpd.c,

I created one patch that it will go to set the $CGI_* environment variable to
GET methods, as the example below.

http://hostname/cgi-bin/script.sh?string=Hello%20World

will set the $CGI_STRING environment variable to "Hello World".

the patch is annexed.

--
Atenciosamente,
Marc Victor Carvalho Cabadas
bac@oops.com.br
["patch-httpd.c" (application/octet-stream)]

807a808,858
> /****************************************************************************
>  *
>  > $Function: addEnvCgi
>  *
>  * $Description: Create environment variables given a URL encoded arg list.
>  *   For each variable setting the URL encoded arg list, create a corresponding
>  *   environment variable.  URL encoded arguments have the form
>  *      name1=value1&name2=value2&name3=value3
>  *
>  * $Parameters:
>  *      (char *) pargs . . . . A pointer to the URL encoded arguments.
>  *
>  * $Return: None
>  *
>  * $Errors: None
>  *
>  ****************************************************************************/
> static void addEnvCgi(const char *pargs)
> {
>   char *args;
>   if (pargs==0) return;
>   
>   args = strdup(pargs);
>   while (args && *args)
>   {
>     char *sep;
>     char *name=args;
>     char *value=strchr(args,'=');
>     int i;
>     if (!value) break;
>     *value++=0;
>     sep=strchr(value,'&');
>     
>     if (sep)
>     {
>       *sep=0;
>       args=sep+1;
>     }
>     else
>     {
>       sep = value + strlen(value);
>       args = 0; /* no more */
>     }
>     for (i=0; name[i]!=0; i++)
>       name[i] = toupper(name[i]);
>       
>     addEnv("CGI", name ,decodeString(value,strlen(value)));
>   }
> }
> 
1137a1189
>       addEnvCgi(urlArgs);


_______________________________________________
busybox mailing list
busybox@mail.busybox.net
http://codepoet.org/mailman/listinfo/busybox


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic