Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'release/0.4.7'

  • Loading branch information...
commit d4f5f64017f9a291acef2d9f01750f73297778a4 2 parents 177e96f + 12d7cc4
Mark Ellzey authored
Showing with 62 additions and 15 deletions.
  1. +1 −1  CMakeLists.txt
  2. +22 −1 ChangeLog
  3. +37 −11 evhtp.c
  4. +2 −2 evhtp.h
View
2  CMakeLists.txt
@@ -3,7 +3,7 @@ project(reason)
set(PROJECT_MAJOR_VERSION 0)
set(PROJECT_MINOR_VERSION 4)
-set(PROJECT_PATCH_VERSION 6)
+set(PROJECT_PATCH_VERSION 7)
set (PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION})
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
View
23 ChangeLog
@@ -1,4 +1,25 @@
-v0.5.6
+v0.4.7
+=====================================
+2012-02-06 Mark Ellzey <mark.thomas@mandiant.com>
+
+ * evhtp.c: set request status to PAUSE if evhtp_request_pause() is called
+ manually.
+
+2012-01-29 Mark Ellzey <socket@gmail.com>
+
+ * evhtp.c: evhtp_parse_query() is no longer limited to 1024 byte key/val
+
+ * evhtp.c: Fixed issue with _evhtp_request_parser_path with no matched
+ callbacks where the end offset was never being set. (Reported by
+ snnn119@gmail.com)
+
+2012-01-24 Stephen Cox <stephen.cox@mandiant.com>
+
+ * evhtp.c, evhtp.h, test.c: Allow SSL_CTX_set_timeout value to be passed in
+ via config.
+
+
+v0.4.6
=====================================
2012-01-11 Mark Ellzey <mark.thomas@mandiant.com>
View
48 evhtp.c
@@ -941,7 +941,7 @@ _evhtp_request_parser_path(htparser * p, const char * data, size_t len) {
cbarg = c->htp->defaults.cbarg;
path->matched_soff = 0;
- path->matched_soff = (unsigned int)strlen(path->full);
+ path->matched_eoff = (unsigned int)strlen(path->full);
}
_evhtp_unlock(c->htp);
@@ -1543,6 +1543,7 @@ evhtp_connection_resume(evhtp_connection_t * c) {
*/
void
evhtp_request_pause(evhtp_request_t * request) {
+ request->status = EVHTP_RES_PAUSE;
return evhtp_connection_pause(request->conn);
}
@@ -1874,9 +1875,9 @@ evhtp_unescape_string(unsigned char ** out, unsigned char * str, size_t str_len)
evhtp_query_t *
evhtp_parse_query(const char * query, size_t len) {
evhtp_query_t * query_args;
- query_parser_state state = s_query_start;
- char key_buf[1024];
- char val_buf[1024];
+ query_parser_state state = s_query_start;
+ char * key_buf = NULL;
+ char * val_buf = NULL;
int key_idx;
int val_idx;
int res;
@@ -1885,22 +1886,31 @@ evhtp_parse_query(const char * query, size_t len) {
query_args = evhtp_query_new();
- key_idx = 0;
- val_idx = 0;
+ if (!(key_buf = malloc(len))) {
+ return NULL;
+ }
+
+ if (!(val_buf = malloc(len))) {
+ free(key_buf);
+ return NULL;
+ }
+
+ key_idx = 0;
+ val_idx = 0;
for (i = 0; i < len; i++) {
res = 0;
ch = query[i];
- if (key_idx >= sizeof(key_buf) || val_idx >= sizeof(val_buf)) {
+ if (key_idx >= len || val_idx >= len) {
res = -1;
goto error;
}
switch (state) {
case s_query_start:
- memset(key_buf, 0, sizeof(key_buf));
- memset(val_buf, 0, sizeof(val_buf));
+ memset(key_buf, 0, len);
+ memset(val_buf, 0, len);
key_idx = 0;
val_idx = 0;
@@ -1976,8 +1986,8 @@ evhtp_parse_query(const char * query, size_t len) {
case '&':
evhtp_kvs_add_kv(query_args, evhtp_kv_new(key_buf, val_buf, 1, 1));
- memset(key_buf, 0, sizeof(key_buf));
- memset(val_buf, 0, sizeof(val_buf));
+ memset(key_buf, 0, len);
+ memset(val_buf, 0, len);
key_idx = 0;
val_idx = 0;
@@ -2031,8 +2041,24 @@ evhtp_parse_query(const char * query, size_t len) {
evhtp_kvs_add_kv(query_args, evhtp_kv_new(key_buf, val_buf, 1, 1));
}
+ if (key_buf) {
+ free(key_buf);
+ }
+
+ if (val_buf) {
+ free(val_buf);
+ }
+
return query_args;
error:
+ if (key_buf) {
+ free(key_buf);
+ }
+
+ if (val_buf) {
+ free(val_buf);
+ }
+
return NULL;
} /* evhtp_parse_query */
View
4 evhtp.h
@@ -145,10 +145,10 @@ typedef void (*evhtp_ssl_scache_del)(evhtp_t * htp, unsigned char * sid, int sid
typedef evhtp_ssl_sess_t * (*evhtp_ssl_scache_get)(evhtp_connection_t * connection, unsigned char * sid, int sid_len);
typedef void * (*evhtp_ssl_scache_init)(evhtp_t *);
-#define EVHTP_VERSION "0.4.6"
+#define EVHTP_VERSION "0.4.7"
#define EVHTP_VERSION_MAJOR 0
#define EVHTP_VERSION_MINOR 4
-#define EVHTP_VERSION_PATCH 6
+#define EVHTP_VERSION_PATCH 7
#define evhtp_headers_iterator evhtp_kvs_iterator
Please sign in to comment.
Something went wrong with that request. Please try again.