mturk       2004/07/30 01:53:32

  Modified:    ajp/ajplib/test testajp.c
  Log:
  Added simple post data and read_header.
  What we need is function to send the post data to the backend.
  
  Revision  Changes    Path
  1.7       +17 -4     jakarta-tomcat-connectors/ajp/ajplib/test/testajp.c
  
  Index: testajp.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/testajp.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- testajp.c 29 Jul 2004 08:12:57 -0000      1.6
  +++ testajp.c 30 Jul 2004 08:53:31 -0000      1.7
  @@ -39,6 +39,12 @@
   #include <arpa/inet.h>
   #endif
   
  +#define TEST_POST_DATA "This document is a proposal of evolution of the current " \
  +                       "Apache JServ Protocol version 1.3, also known as ajp13. " \
  +                       "I'll not cover here the full protocol but only the add-on 
from ajp13. " \
  +                       "This nth pass include comments from the tomcat-dev list and 
" \
  +                       "misses discovered during developpment."
  +
   #define TEST_CASE_URL "http://localhost/servlets-examples/HelloWorldExample";
   
   /* Main process */
  @@ -78,7 +84,6 @@
       return APR_SUCCESS;
   }
   
  -
   #if APR_HAS_THREADS
   
   #define TEST_THREAD_COUNT   10
  @@ -157,6 +162,7 @@
       conn_rec *c, *con;
       request_rec *r;
       apr_socket_t *sock;
  +    ajp_msg_t *msg;
   
       apr_app_initialize(&argc, &argv, &env);
   
  @@ -186,7 +192,9 @@
       
       /* 0. Fill in the request data          */
       if (ap_wrap_make_request(r, TEST_CASE_URL,
  -                             NULL, NULL, NULL, 0, NULL) != APR_SUCCESS) {
  +                             "POST", NULL, NULL,
  +                             0,
  +                             NULL) != APR_SUCCESS) {
           goto finished;
       }
       /*
  @@ -198,20 +206,25 @@
       /* 1. Obtain a connection to backend    */
       if ((rc = connect_to_backend(&sock, &con, "127.0.0.1", 8009,
               main_server, r->pool)) != APR_SUCCESS) {
  -        ap_log_error(APLOG_MARK, APLOG_INFO, rc, NULL, "connect_to_backend");
  +        ap_log_error(APLOG_MARK, APLOG_ERR, rc, NULL, "connect_to_backend");
           rv = -1;
           goto finished;
       }
   
       /* 2. Create AJP message                */
       if ((rc = ajp_send_header(sock, r)) != APR_SUCCESS) {
  -        ap_log_error(APLOG_MARK, APLOG_INFO, rc, NULL, "ajp_send_header");
  +        ap_log_error(APLOG_MARK, APLOG_ERR, rc, NULL, "ajp_send_header");
           rv = -1;
           goto finished;
       }
       /* 3. Send AJP message                  */
   
       /* 4. Read AJP response                 */
  +    if ((rc = ajp_read_header(sock, r, &msg)) != APR_SUCCESS) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR, rc, NULL, "ajp_read_header");
  +        rv = -1;
  +        goto finished;
  +    }
   
       /* 5. Display results                   */
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to