Changeset 646
- Timestamp:
- 02/18/07 19:14:22 (2 years ago)
- Files:
-
- cherokee/trunk/ChangeLog (modified) (1 diff)
- cherokee/trunk/cherokee/buffer.c (modified) (1 diff)
- cherokee/trunk/cherokee/connection-protected.h (modified) (1 diff)
- cherokee/trunk/cherokee/connection.c (modified) (3 diffs)
- cherokee/trunk/cherokee/handler_admin.c (modified) (4 diffs)
- cherokee/trunk/cherokee/post.c (modified) (5 diffs)
- cherokee/trunk/cherokee/post.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/ChangeLog
r645 r646 1 2007-02-18 A.D.F <adefacc@tin.it> 2 3 * cherokee/post.h, cherokee/post.c cherokee/connection.c, 4 cherokee/handler_admin.c: 5 - use off_t instead of offset_t in order 6 to compile cherokee when off_t has a size of 4 bytes 7 instead of 8 (i.e. on embedded systems or when 8 --disable-largefile is given on configure command line). 9 10 * cherokee/connection-protected.h: 11 - don't use "enum" for bit flags because more than 12 one option can be set, so its better to explicitely use 13 an unsigned int as data type. 14 1 15 2007-02-16 Alvaro Lopez Ortega <alvaro@alobbs.com> 2 16 cherokee/trunk/cherokee/buffer.c
r624 r646 1606 1606 /* Substitute (substring)s found in (bufsrc) with (replacement) 1607 1607 * and writes the resulting content to (bufdst). 1608 * NOTE: (bufdst) is written only if at least on (substring) instance1609 * is found in (bufsrc) , in thiscase return value is ret_ok;1608 * NOTE: (bufdst) is written only if at least one (substring) instance 1609 * is found in (bufsrc); in that case return value is ret_ok; 1610 1610 * if (substring) is NOT found in (bufsrc) then nothing is done 1611 1611 * in order to avoid an unnecessary copy of data. cherokee/trunk/cherokee/connection-protected.h
r642 r646 82 82 } cherokee_connection_phase_t; 83 83 84 typedef enum { 85 conn_op_nothing = 0, 86 conn_op_log_at_end = (1 << 0), 87 conn_op_root_index = (1 << 1), 88 conn_op_tcp_cork = (1 << 2) 89 } cherokee_connection_options_t; 84 85 #define conn_op_nothing 0 86 #define conn_op_log_at_end (1 << 0) 87 #define conn_op_root_index (1 << 1) 88 #define conn_op_tcp_cork (1 << 2) 89 90 typedef cuint_t cherokee_connection_options_t; 90 91 91 92 cherokee/trunk/cherokee/connection.c
r642 r646 1286 1286 { 1287 1287 ret_t ret; 1288 longpost_len;1288 off_t post_len; 1289 1289 char *info = NULL; 1290 1290 cuint_t info_len = 0; … … 1309 1309 buf[info_len] = '\0'; 1310 1310 1311 post_len = atol(buf);1311 post_len = (off_t) atol(buf); 1312 1312 if (post_len < 0) { 1313 1313 conn->error_code = http_bad_request; … … 1443 1443 /* Set the virtual server reference 1444 1444 */ 1445 cherokee_server_get_vserver (CONN_SRV(conn), &conn->host, &conn->vserver); 1445 cherokee_server_get_vserver (CONN_SRV(conn), &conn->host, 1446 (cherokee_virtual_server_t **) &conn->vserver); 1446 1447 break; 1447 1448 cherokee/trunk/cherokee/handler_admin.c
r597 r646 124 124 { 125 125 char *tmp; 126 off set_tpostl;126 off_t postl; 127 127 ret_t ret = ret_ok; 128 128 cherokee_buffer_t post = CHEROKEE_BUF_INIT; … … 133 133 */ 134 134 cherokee_post_get_len (&conn->post, &postl); 135 if (postl <= 0 ) {135 if (postl <= 0 || postl >= (INT_MAX-1)) { 136 136 conn->error_code = http_bad_request; 137 137 return ret_error; … … 140 140 /* Process line per line 141 141 */ 142 cherokee_post_walk_read (&conn->post, &post, postl);142 cherokee_post_walk_read (&conn->post, &post, (cuint_t) postl); 143 143 144 144 for (tmp = post.buf;;) { … … 164 164 goto go_out; 165 165 } 166 166 167 167 /* Clean up for the next iteration 168 168 */ 169 169 cherokee_buffer_clean (&line); 170 170 } 171 171 172 172 go_out: 173 173 cherokee_buffer_mrproper (&post); cherokee/trunk/cherokee/post.c
r597 r646 75 75 76 76 ret_t 77 cherokee_post_set_len (cherokee_post_t *post, off set_t len)77 cherokee_post_set_len (cherokee_post_t *post, off_t len) 78 78 { 79 79 post->type = (len > POST_SIZE_TO_DISK) ? post_in_tmp_file : post_in_memory; … … 83 83 char *ptr; 84 84 char template[64]; 85 85 86 86 strncpy (template, "/tmp/cherokee_post_XXXXXX", sizeof(template)); 87 87 88 88 /* Generate a unique name 89 89 */ … … 91 91 if (unlikely (ptr == NULL)) 92 92 return ret_error; 93 93 94 94 cherokee_buffer_add (&post->tmp_file, ptr, strlen(ptr)); 95 95 … … 100 100 return ret_error; 101 101 } 102 102 103 103 return ret_ok; 104 104 } … … 119 119 120 120 ret_t 121 cherokee_post_get_len (cherokee_post_t *post, off set_t *len)121 cherokee_post_get_len (cherokee_post_t *post, off_t *len) 122 122 { 123 123 *len = post->size; cherokee/trunk/cherokee/post.h
r597 r646 61 61 int cherokee_post_got_all (cherokee_post_t *post); 62 62 63 ret_t cherokee_post_set_len (cherokee_post_t *post, off set_t len);64 ret_t cherokee_post_get_len (cherokee_post_t *post, off set_t *len);63 ret_t cherokee_post_set_len (cherokee_post_t *post, off_t len); 64 ret_t cherokee_post_get_len (cherokee_post_t *post, off_t *len); 65 65 66 66 ret_t cherokee_post_append (cherokee_post_t *post, char *str, size_t len);