jfclere     2004/07/29 02:58:48

  Modified:    ajp/ajplib/test ajp_header.c
  Log:
  Add a read routine... It returns the message to reuse it.
  
  Revision  Changes    Path
  1.11      +31 -0     jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.c
  
  Index: ajp_header.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/ajplib/test/ajp_header.c,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ajp_header.c      29 Jul 2004 08:23:42 -0000      1.10
  +++ ajp_header.c      29 Jul 2004 09:58:48 -0000      1.11
  @@ -728,3 +728,34 @@
   
       return APR_SUCCESS;
   }
  +
  +/*
  + * Read the ajp message and return the type of the message.
  + */
  +apr_status_t ajp_read_header(apr_socket_t *sock,
  +                                  request_rec  *r,
  +                                  void **data)
  +{
  +    apr_byte_t result;
  +    ajp_msg_t *msg;
  +    apr_status_t rc;
  +
  +    ajp_msg_reset(msg);
  +    rc = ajp_msg_create(r->pool, &msg);
  +    if (rc != APR_SUCCESS) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
  +               "ajp_read_header: ajp_msg_create failed");
  +        return rc;
  +    }
  +    rc = ajp_ilink_receive(sock, msg);
  +    if (rc != APR_SUCCESS) {
  +        ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
  +               "ajp_read_header: ajp_ilink_receive failed");
  +        return rc;
  +    }
  +    rc = ajp_msg_peek_byte(msg,&result);
  +    ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
  +               "ajp_read_header: ajp_ilink_received %02x", result);
  +    *data = msg;
  +    return APR_SUCCESS;
  +}
  
  
  

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

Reply via email to