costin 01/12/15 09:24:16 Modified: jk/native2/common jk_requtil.c jk_serialize_ajp.c Log: Change headers, attributes to jk_map. Revision Changes Path 1.4 +7 -10 jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c Index: jk_requtil.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_requtil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- jk_requtil.c 2001/12/12 21:52:40 1.3 +++ jk_requtil.c 2001/12/15 17:24:16 1.4 @@ -254,13 +254,16 @@ char *jk_requtil_getCookieByName(jk_ws_service_t *s, const char *name) { - unsigned i; + int i; + jk_map_t *headers=s->headers_in; - for(i = 0 ; i < s->num_headers ; i++) { - if(0 == strcasecmp(s->headers_names[i], "cookie")) { + /* XXX use 'get' - and make sure jk_map has support for + case insensitive search */ + for(i = 0 ; i < headers->size( NULL, headers ) ; i++) { + if(0 == strcasecmp(headers->nameAt( NULL, headers, i), "cookie")) { char *id_start; - for(id_start = strstr(s->headers_values[i], name) ; + for(id_start = strstr( headers->valueAt( NULL, headers, i ), name) ; id_start ; id_start = strstr(id_start + 1, name)) { if('=' == id_start[strlen(name)]) { @@ -429,11 +432,5 @@ s->ssl_cert_len = 0; s->ssl_cipher = NULL; s->ssl_session = NULL; - s->headers_names = NULL; - s->headers_values = NULL; - s->num_headers = 0; - s->attributes_names = NULL; - s->attributes_values = NULL; - s->num_attributes = 0; s->jvm_route = NULL; } 1.2 +18 -11 jakarta-tomcat-connectors/jk/native2/common/jk_serialize_ajp.c Index: jk_serialize_ajp.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native2/common/jk_serialize_ajp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- jk_serialize_ajp.c 2001/12/12 21:37:13 1.1 +++ jk_serialize_ajp.c 2001/12/15 17:24:16 1.2 @@ -174,7 +174,8 @@ jk_ws_service_t *s ) { unsigned char method; - unsigned i; + int i; + int headerCount; jk_logger_t *l=msg->l; l->jkLog(l, JK_LOG_DEBUG, "Into ajp_marshal_into_msgb\n"); @@ -185,6 +186,8 @@ return JK_FALSE; } + headerCount=s->headers_in->size(NULL, s->headers_in); + if (msg->appendByte(msg, JK_AJP13_FORWARD_REQUEST) || msg->appendByte(msg, method) || msg->appendString(msg, s->protocol) || @@ -194,31 +197,33 @@ msg->appendString(msg, s->server_name) || msg->appendInt(msg, (unsigned short)s->server_port) || msg->appendByte(msg, (unsigned char)(s->is_ssl)) || - msg->appendInt(msg, (unsigned short)(s->num_headers))) { + msg->appendInt(msg, (unsigned short)(headerCount))) { l->jkLog(l, JK_LOG_ERROR, "handle.request() Error serializing the message head\n"); return JK_FALSE; } - for (i = 0 ; i < s->num_headers ; i++) { + for (i = 0 ; i < headerCount ; i++) { unsigned short sc; + + char *name=s->headers_in->nameAt(NULL, s->headers_in, i); - if (jk_requtil_getHeaderId(s->headers_names[i], &sc)) { + if (jk_requtil_getHeaderId(name, &sc)) { if (msg->appendInt(msg, sc)) { l->jkLog(l, JK_LOG_ERROR, "handle.request() Error serializing header id\n"); return JK_FALSE; } } else { - if (msg->appendString(msg, s->headers_names[i])) { + if (msg->appendString(msg, name)) { l->jkLog(l, JK_LOG_ERROR, "handle.request() Error serializing header name\n"); return JK_FALSE; } } - if (msg->appendString(msg, s->headers_values[i])) { + if (msg->appendString(msg, s->headers_in->valueAt( NULL, s->headers_in, i))) { l->jkLog(l, JK_LOG_ERROR, "handle.request() Error serializing header value\n"); return JK_FALSE; @@ -301,14 +306,16 @@ } - if (s->num_attributes > 0) { - for (i = 0 ; i < s->num_attributes ; i++) { + if (s->attributes->size( NULL, s->attributes) > 0) { + for (i = 0 ; i < s->attributes->size( NULL, s->attributes) ; i++) { + char *name=s->attributes->nameAt( NULL, s->attributes, i); + char *val=s->attributes->nameAt( NULL, s->attributes, i); if (msg->appendByte(msg, SC_A_REQ_ATTRIBUTE) || - msg->appendString(msg, s->attributes_names[i]) || - msg->appendString(msg, s->attributes_values[i])) { + msg->appendString(msg, name ) || + msg->appendString(msg, val)) { l->jkLog(l, JK_LOG_ERROR, "handle.request() Error serializing attribute %s=%s\n", - s->attributes_names[i], s->attributes_values[i]); + name, val); return JK_FALSE; } }
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>