]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Mirror 1.1.x changes.
authormike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 29 Jun 2004 04:31:03 +0000 (04:31 +0000)
committermike <mike@7a7537e8-13f0-0310-91df-b6672ffda945>
Tue, 29 Jun 2004 04:31:03 +0000 (04:31 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.2@4219 7a7537e8-13f0-0310-91df-b6672ffda945

CHANGES-1.1.txt
scheduler/client.c

index 2f25b656b7b5feb31ab0db55784f2c76a0f83afb..af5328063925bae4708ad4732ec71fa0c581049f 100644 (file)
@@ -3,6 +3,8 @@ CHANGES-1.1.txt
 
 CHANGES IN CUPS V1.1.21rc2
 
+       - The scheduler didn't handle HTTP GET form data
+         properly (STR #744)
        - The pstops filter now makes sure that the prolog code
          is sent before the setup code (STR #776)
        - The pstops filter now handles print files that
index 006a7774f14fe3a909ad22851984b3da731bcece..b310aa308cec43596e23a0b2f14cf90855e0bb33 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * "$Id: client.c,v 1.91.2.83 2004/06/29 02:45:24 mike Exp $"
+ * "$Id: client.c,v 1.91.2.84 2004/06/29 04:31:03 mike Exp $"
  *
  *   Client routines for the Common UNIX Printing System (CUPS) scheduler.
  *
@@ -2900,6 +2900,7 @@ pipe_command(client_t *con,               /* I - Client connection */
   int          i;                      /* Looping var */
   int          pid;                    /* Process ID */
   char         *commptr;               /* Command string pointer */
+  char         *query;                 /* Query string pointer */
   char         *uriptr;                /* URI string pointer */
   int          fd;                     /* Looping var */
   int          fds[2];                 /* Pipe FDs */
@@ -2995,6 +2996,7 @@ pipe_command(client_t *con,               /* I - Client connection */
   */
 
   argv[0] = argbuf;
+  query   = NULL;
 
   for (commptr = argbuf, argc = 1; *commptr != '\0' && argc < 99; commptr ++)
     if (*commptr == ' ' || *commptr == '+')
@@ -3010,6 +3012,14 @@ pipe_command(client_t *con,              /* I - Client connection */
        argc ++;
       }
 
+
+     /*
+      * Copy query data, if any, from arguments...
+      */
+
+      if (argc == 2 && strchr(commptr, '=') && con->operation == HTTP_GET)
+       query = strdup(commptr);
+
       commptr --;
     }
     else if (*commptr == '%' && isxdigit(commptr[1] & 255) &&
@@ -3027,8 +3037,6 @@ pipe_command(client_t *con,               /* I - Client connection */
 
       cups_strcpy(commptr + 1, commptr + 3);
     }
-    else if (*commptr == '?')
-      break;
 
   argv[argc] = NULL;
 
@@ -3165,16 +3173,15 @@ pipe_command(client_t *con,             /* I - Client connection */
       LogMessage(L_DEBUG2, "argv[%d] = \"%s\"", i, argv[i]);
     envp[envc ++] = "REQUEST_METHOD=GET";
 
-    if (*commptr)
+    if (query)
     {
      /*
       * Add GET form variables after ?...
       */
 
-      *commptr++ = '\0';
-
-      snprintf(query_string, sizeof(query_string), "QUERY_STRING=%s", commptr);
+      snprintf(query_string, sizeof(query_string), "QUERY_STRING=%s", query);
       envp[envc ++] = query_string;
+      free(query);
     }
   }
   else
@@ -3405,5 +3412,5 @@ CDSAWriteFunc(SSLConnectionRef connection,        /* I  - SSL/TLS connection */
 
 
 /*
- * End of "$Id: client.c,v 1.91.2.83 2004/06/29 02:45:24 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.84 2004/06/29 04:31:03 mike Exp $".
  */