Diff for /libaitwww/example/test.c between versions 1.1.2.5 and 1.4

version 1.1.2.5, 2012/03/09 12:47:33 version 1.4, 2013/05/30 09:25:35
Line 1 Line 1
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
   #include <string.h>
 #include <aitwww.h>  #include <aitwww.h>
   
   
Line 10  showPair(struct tagCGI *c, void *arg) Line 11  showPair(struct tagCGI *c, void *arg)
                 printf("ARG=%s ... ", arg);                  printf("ARG=%s ... ", arg);
   
         printf("next=%p ... ", c->cgi_node.sle_next);          printf("next=%p ... ", c->cgi_node.sle_next);
        printf("name=%s value=%s\n", c->cgi_name, c->cgi_value);        printf("name=%s value=%s\n", AIT_GET_STR(c->cgi_name), AIT_GET_STR(c->cgi_value));
         return 0;          return 0;
 }  }
   
Line 34  main(int argc, char **argv) Line 35  main(int argc, char **argv)
   
                 printf("%s\n%s\n", www_getValue(cgi, "testche"), www_getValue(cgi, "test1"));                  printf("%s\n%s\n", www_getValue(cgi, "testche"), www_getValue(cgi, "test1"));
   
                cgi1 = www_parseQuery("blahA=this is a string&blahB=this is another string");                cgi1 = www_parseQuery("blahA=this%20is+a%20string&blahB=this is another string");
                 if (!cgi1) {                  if (!cgi1) {
                         printf("Error:: #%d - %s\n", www_GetErrno(), www_GetError());                          printf("Error:: #%d - %s\n", www_GetErrno(), www_GetError());
                         www_closeCGI(&cgi);                          www_closeCGI(&cgi);
Line 60  main(int argc, char **argv) Line 61  main(int argc, char **argv)
                 putenv("REQUEST_METHOD=POST");                  putenv("REQUEST_METHOD=POST");
                 putenv("CONTENT_LENGTH=1000");                  putenv("CONTENT_LENGTH=1000");
                 if (!strcmp(argv[1], "multi"))                  if (!strcmp(argv[1], "multi"))
                        putenv("CONTENT_TYPE=multipart/form-data");                        putenv("CONTENT_TYPE=multipart/form-data; boundary=012345678909876543210");
                 else                  else
                         putenv("CONTENT_TYPE=application/x-www-form-urlencoded");                          putenv("CONTENT_TYPE=application/x-www-form-urlencoded");
   

Removed from v.1.1.2.5  
changed lines
  Added in v.1.4


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>