You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-cvs@httpd.apache.org by do...@apache.org on 2001/06/13 00:46:41 UTC

cvs commit: httpd-apreq/eg/c/testapreq mod_testapreq.c

dougm       01/06/12 15:46:40

  Modified:    Request  Request.xs
               c        apache_multipart_buffer.c apache_request.c
                        apache_request.h
               eg/c/testapreq mod_testapreq.c
  Log:
  s/strcmp/strEQ/g
  s/strcasecmp/strcaseEQ/q
  s/strcaseEQN/strncaseEQ/g
  
  Revision  Changes    Path
  1.24      +7 -7      httpd-apreq/Request/Request.xs
  
  Index: Request.xs
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/Request/Request.xs,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- Request.xs	2001/06/12 22:36:13	1.23
  +++ Request.xs	2001/06/12 22:46:36	1.24
  @@ -310,31 +310,31 @@
   
           switch (toLOWER(*key)) {
             case 'd':
  -            if (strcasecmp(key, "disable_uploads") == 0) {
  +            if (strcaseEQ(key, "disable_uploads")) {
                   RETVAL->disable_uploads = (int)SvIV(ST(i+1));
                   break;
               }
   
             case 'h':
  -            if (strcasecmp(key, "hook_data") == 0) {
  +            if (strcaseEQ(key, "hook_data")) {
                   XsUploadHookSet(data, ST(i+1));
                   break;
               }
   
             case 'p':
  -            if (strcasecmp(key, "post_max") == 0) {
  +            if (strcaseEQ(key, "post_max")) {
                   RETVAL->post_max = (int)SvIV(ST(i+1));
                   break;
               }
   
             case 't':
  -            if (strcasecmp(key, "temp_dir") == 0) {
  +            if (strcaseEQ(key, "temp_dir")) {
                   RETVAL->temp_dir = (char *)SvPV(ST(i+1), PL_na);
                   break;
               }
   
             case 'u':
  -            if (strcasecmp(key, "upload_hook") == 0) {
  +            if (strcaseEQ(key, "upload_hook")) {
                   XsUploadHookSet(sub, ST(i+1));
                   RETVAL->upload_hook = upload_hook;
                   break;
  @@ -417,7 +417,7 @@
   	        array_header *arr  = ap_table_elts(req->parms);
   	        table_entry *elts = (table_entry *)arr->elts;
   	        for (i = 0; i < arr->nelts; ++i) {
  -	            if (elts[i].key && !strcasecmp(elts[i].key, key))
  +	            if (elts[i].key && strcaseEQ(elts[i].key, key))
   	            	XPUSHs(sv_2mortal(newSVpv(elts[i].val,0)));
   	        }
   	    }
  @@ -446,7 +446,7 @@
   	           if (!elts[i].key) continue;
   		    /* simple but inefficient uniqueness check */
   		    for (j = 0; j < i; ++j) { 
  -		        if (!strcasecmp(elts[i].key, elts[j].key))
  +		        if (strcaseEQ(elts[i].key, elts[j].key))
   			    break;
   		    }
   	            if ( i == j )
  
  
  
  1.7       +1 -1      httpd-apreq/c/apache_multipart_buffer.c
  
  Index: apache_multipart_buffer.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/c/apache_multipart_buffer.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apache_multipart_buffer.c	2001/06/12 21:17:21	1.6
  +++ apache_multipart_buffer.c	2001/06/12 22:46:37	1.7
  @@ -192,7 +192,7 @@
   #endif
   
         /* finished if we found the boundary */
  -      if(strcmp(line, boundary) == 0)
  +      if(strEQ(line, boundary))
   	  return 1;
       }
   
  
  
  
  1.13      +3 -3      httpd-apreq/c/apache_request.c
  
  Index: apache_request.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/c/apache_request.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- apache_request.c	2001/06/08 22:20:40	1.12
  +++ apache_request.c	2001/06/12 22:46:38	1.13
  @@ -276,10 +276,10 @@
   
       if (r->method_number == M_POST) { 
   	const char *ct = ap_table_get(r->headers_in, "Content-type"); 
  -	if (ct && strcaseEQN(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
  +	if (ct && strncaseEQ(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
   	    result = ApacheRequest_parse_urlencoded(req); 
   	}
  -	else if (ct && strcaseEQN(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) {
  +	else if (ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) {
   	   result = ApacheRequest_parse_multipart(req); 
   	}
   	else {
  @@ -307,7 +307,7 @@
   
   	type = ap_table_get(r->headers_in, "Content-Type");
   
  -	if (!strcaseEQN(type, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
  +	if (!strncaseEQ(type, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
   	    return DECLINED;
   	}
   	if ((rc = util_read(req, &data)) != OK) {
  
  
  
  1.7       +2 -2      httpd-apreq/c/apache_request.h
  
  Index: apache_request.h
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/c/apache_request.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- apache_request.h	2001/06/02 13:41:23	1.6
  +++ apache_request.h	2001/06/12 22:46:38	1.7
  @@ -70,8 +70,8 @@
   #define strcaseEQ(s1,s2) (!strcasecmp(s1,s2))
   #endif
   
  -#ifndef strcaseEQN
  -#define strcaseEQN(s1,s2,n) (!strncasecmp(s1,s2,n))
  +#ifndef strncaseEQ
  +#define strncaseEQ(s1,s2,n) (!strncasecmp(s1,s2,n))
   #endif
   
   #define DEFAULT_TABLE_NELTS 10
  
  
  
  1.2       +1 -1      httpd-apreq/eg/c/testapreq/mod_testapreq.c
  
  Index: mod_testapreq.c
  ===================================================================
  RCS file: /home/cvs/httpd-apreq/eg/c/testapreq/mod_testapreq.c,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- mod_testapreq.c	1999/01/27 01:33:20	1.1
  +++ mod_testapreq.c	2001/06/12 22:46:40	1.2
  @@ -48,7 +48,7 @@
   {
       int i;
       for(i=0; list[i]; i++) {
  -	if(!strcmp(wanted, list[i]))
  +	if(strEQ(wanted, list[i]))
   	    return 1;
       }
       return 0;