00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <stdlib.h>
00025
00026 #include "hi_si.h"
00027 #include "hi_eo.h"
00028 #include "hi_util_xmalloc.h"
00029 #include "hi_return_codes.h"
00030
00031
00032
00033
00034
00035
00036
00037
00038 static HI_EVENT_INFO client_event_info[HI_EO_CLIENT_EVENT_NUM] = {
00039 { HI_EO_CLIENT_ASCII, HI_EO_LOW_PRIORITY, HI_EO_CLIENT_ASCII_STR },
00040 { HI_EO_CLIENT_DOUBLE_DECODE, HI_EO_HIGH_PRIORITY,
00041 HI_EO_CLIENT_DOUBLE_DECODE_STR },
00042 { HI_EO_CLIENT_U_ENCODE, HI_EO_MED_PRIORITY, HI_EO_CLIENT_U_ENCODE_STR },
00043 { HI_EO_CLIENT_BARE_BYTE, HI_EO_HIGH_PRIORITY, HI_EO_CLIENT_BARE_BYTE_STR},
00044 { HI_EO_CLIENT_BASE36, HI_EO_HIGH_PRIORITY, HI_EO_CLIENT_BASE36_STR },
00045 { HI_EO_CLIENT_UTF_8, HI_EO_LOW_PRIORITY, HI_EO_CLIENT_UTF_8_STR },
00046 { HI_EO_CLIENT_IIS_UNICODE, HI_EO_LOW_PRIORITY,
00047 HI_EO_CLIENT_IIS_UNICODE_STR },
00048 { HI_EO_CLIENT_MULTI_SLASH, HI_EO_MED_PRIORITY,
00049 HI_EO_CLIENT_MULTI_SLASH_STR },
00050 { HI_EO_CLIENT_IIS_BACKSLASH, HI_EO_MED_PRIORITY,
00051 HI_EO_CLIENT_IIS_BACKSLASH_STR },
00052 { HI_EO_CLIENT_SELF_DIR_TRAV, HI_EO_HIGH_PRIORITY,
00053 HI_EO_CLIENT_SELF_DIR_TRAV_STR },
00054 { HI_EO_CLIENT_DIR_TRAV, HI_EO_LOW_PRIORITY, HI_EO_CLIENT_DIR_TRAV_STR },
00055 { HI_EO_CLIENT_APACHE_WS, HI_EO_MED_PRIORITY, HI_EO_CLIENT_APACHE_WS_STR },
00056 { HI_EO_CLIENT_IIS_DELIMITER, HI_EO_MED_PRIORITY,
00057 HI_EO_CLIENT_IIS_DELIMITER_STR },
00058 { HI_EO_CLIENT_NON_RFC_CHAR, HI_EO_HIGH_PRIORITY,
00059 HI_EO_CLIENT_NON_RFC_CHAR_STR },
00060 { HI_EO_CLIENT_OVERSIZE_DIR, HI_EO_HIGH_PRIORITY,
00061 HI_EO_CLIENT_OVERSIZE_DIR_STR },
00062 {HI_EO_CLIENT_LARGE_CHUNK, HI_EO_HIGH_PRIORITY,
00063 HI_EO_CLIENT_LARGE_CHUNK_STR },
00064 {HI_EO_CLIENT_PROXY_USE, HI_EO_LOW_PRIORITY,
00065 HI_EO_CLIENT_PROXY_USE_STR },
00066 {HI_EO_CLIENT_WEBROOT_DIR, HI_EO_HIGH_PRIORITY,
00067 HI_EO_CLIENT_WEBROOT_DIR_STR }
00068 };
00069
00070 static HI_EVENT_INFO anom_server_event_info[HI_EO_ANOM_SERVER_EVENT_NUM] = {
00071 {HI_EO_ANOM_SERVER, HI_EO_HIGH_PRIORITY, HI_EO_ANOM_SERVER_STR }
00072 };
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 int hi_eo_anom_server_event_log(HI_SESSION *Session, int iEvent, void *data,
00091 void (*free_data)(void *))
00092 {
00093 HI_ANOM_SERVER_EVENTS *anom_server_events;
00094 HI_EVENT *event;
00095 int iCtr;
00096
00097
00098
00099
00100 if(!Session || (iEvent >= HI_EO_ANOM_SERVER_EVENT_NUM))
00101 {
00102 return HI_INVALID_ARG;
00103 }
00104
00105 anom_server_events = &(Session->anom_server.event_list);
00106
00107
00108
00109
00110
00111
00112
00113
00114 for(iCtr = 0; iCtr < anom_server_events->stack_count; iCtr++)
00115 {
00116 if(anom_server_events->stack[iCtr] == iEvent)
00117 {
00118 anom_server_events->events[iEvent].count++;
00119 return HI_SUCCESS;
00120 }
00121 }
00122
00123
00124
00125
00126 event = &(anom_server_events->events[iEvent]);
00127 event->event_info = &anom_server_event_info[iEvent];
00128 event->count = 1;
00129 event->data = data;
00130 event->free_data = free_data;
00131
00132
00133
00134
00135 anom_server_events->stack[anom_server_events->stack_count] = iEvent;
00136 anom_server_events->stack_count++;
00137
00138 return HI_SUCCESS;
00139 }
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166 int hi_eo_client_event_log(HI_SESSION *Session, int iEvent, void *data,
00167 void (*free_data)(void *))
00168 {
00169 HI_CLIENT_EVENTS *client_events;
00170 HI_EVENT *event;
00171 int iCtr;
00172
00173
00174
00175
00176 if(!Session || (iEvent >= HI_EO_CLIENT_EVENT_NUM))
00177 {
00178 return HI_INVALID_ARG;
00179 }
00180
00181 client_events = &(Session->client.event_list);
00182
00183
00184
00185
00186
00187
00188
00189
00190 for(iCtr = 0; iCtr < client_events->stack_count; iCtr++)
00191 {
00192 if(client_events->stack[iCtr] == iEvent)
00193 {
00194 client_events->events[iEvent].count++;
00195 return HI_SUCCESS;
00196 }
00197 }
00198
00199
00200
00201
00202 event = &(client_events->events[iEvent]);
00203 event->event_info = &client_event_info[iEvent];
00204 event->count = 1;
00205 event->data = data;
00206 event->free_data = free_data;
00207
00208
00209
00210
00211 client_events->stack[client_events->stack_count] = iEvent;
00212 client_events->stack_count++;
00213
00214 return HI_SUCCESS;
00215 }