tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject cvs commit: jakarta-tomcat-connectors/jk/native/iis jk_isapi_plugin.c
Date Sat, 23 Apr 2005 10:02:21 GMT
mturk       2005/04/23 03:02:21

  Modified:    jk/native/iis jk_isapi_plugin.c
  Log:
  Log original request instead logging request for isapi extension,
  by using SF_NOTIFY_LOG handler.
  
  Revision  Changes    Path
  1.46      +29 -1     jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c
  
  Index: jk_isapi_plugin.c
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/iis/jk_isapi_plugin.c,v
  retrieving revision 1.45
  retrieving revision 1.46
  diff -u -r1.45 -r1.46
  --- jk_isapi_plugin.c	17 Mar 2005 12:06:03 -0000	1.45
  +++ jk_isapi_plugin.c	23 Apr 2005 10:02:21 -0000	1.46
  @@ -152,6 +152,11 @@
       LPEXTENSION_CONTROL_BLOCK lpEcb;
   };
   
  +typedef struct isapi_log_data_t isapi_log_data_t;
  +struct isapi_log_data_t {
  +    char uri[INTERNET_MAX_URL_LENGTH];
  +    char query[INTERNET_MAX_URL_LENGTH];
  +};
   
   static int JK_METHOD start_response(jk_ws_service_t *s,
                                       int status,
  @@ -649,6 +654,7 @@
                       SF_NOTIFY_SECURE_PORT |
                       SF_NOTIFY_NONSECURE_PORT |
                       SF_NOTIFY_PREPROC_HEADERS |
  +                    SF_NOTIFY_LOG |
                       SF_NOTIFY_AUTH_COMPLETE;
   
       strcpy(pVer->lpszFilterDesc, VERSION_STRING);
  @@ -901,6 +907,20 @@
                       }
                       SetHeader(pfc, "Translate:", NULL);
                   }
  +                if (!pfc->pFilterContext) {
  +                    isapi_log_data_t *ld = (isapi_log_data_t *)pfc->AllocMem(pfc, sizeof(isapi_log_data_t),
0);
  +                    if (!ld) {
  +                        jk_log(logger, JK_LOG_ERROR,
  +                               "error while allocating memory");
  +                        SetLastError(ERROR_NOT_ENOUGH_MEMORY);
  +                        return SF_STATUS_REQ_ERROR;
  +                    }
  +                    memset(ld, 0, sizeof(isapi_log_data_t));
  +                    strcpy(ld->uri, forwardURI);
  +                    if (query && strlen(query) > 0)
  +                        strcpy(ld->query, query);
  +                    pfc->pFilterContext = ld;
  +                }
               }
               else {
                   if (JK_IS_DEBUG_LEVEL(logger))
  @@ -909,6 +929,14 @@
               }
           }
       }
  +    else if (is_inited && (dwNotificationType == SF_NOTIFY_LOG)) {
  +        if (pfc->pFilterContext) {
  +            isapi_log_data_t *ld = (isapi_log_data_t *)pfc->pFilterContext;
  +            HTTP_FILTER_LOG  *pl = (HTTP_FILTER_LOG *)pvNotification;
  +            pl->pszTarget = ld->uri;
  +            pl->pszParameters = ld->query;
  +        }
  +    }
       return SF_STATUS_REQ_NEXT_NOTIFICATION;
   }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message