Changeset 1614
- Timestamp:
- 07/07/08 17:11:37 (3 months ago)
- Files:
-
- cherokee/trunk/cherokee/buffer.c (modified) (2 diffs)
- cherokee/trunk/cherokee/buffer.h (modified) (2 diffs)
- cherokee/trunk/cherokee/connection.c (modified) (3 diffs)
- cherokee/trunk/cherokee/connection_info.c (modified) (2 diffs)
- cherokee/trunk/cherokee/downloader.c (modified) (2 diffs)
- cherokee/trunk/cherokee/encoder_gzip.c (modified) (1 diff)
- cherokee/trunk/cherokee/handler_cgi_base.c (modified) (4 diffs)
- cherokee/trunk/cherokee/handler_common.c (modified) (5 diffs)
- cherokee/trunk/cherokee/handler_dirlist.c (modified) (5 diffs)
- cherokee/trunk/cherokee/handler_file.c (modified) (1 diff)
- cherokee/trunk/cherokee/handler_nn.c (modified) (1 diff)
- cherokee/trunk/cherokee/handler_redir.c (modified) (4 diffs)
- cherokee/trunk/cherokee/main_tweak.c (modified) (3 diffs)
- cherokee/trunk/cherokee/plugin_loader.c (modified) (1 diff)
- cherokee/trunk/cherokee/rule_request.c (modified) (1 diff)
- cherokee/trunk/cherokee/url.c (modified) (1 diff)
- cherokee/trunk/cherokee/util.c (modified) (1 diff)
- cherokee/trunk/cherokee/validator_htpasswd.c (modified) (1 diff)
- cherokee/trunk/cherokee/validator_plain.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
cherokee/trunk/cherokee/buffer.c
r1590 r1614 658 658 659 659 int 660 cherokee_buffer_is_end ding (cherokee_buffer_t *buf, char c)660 cherokee_buffer_is_ending (cherokee_buffer_t *buf, char c) 661 661 { 662 662 if (cherokee_buffer_is_empty(buf)) … … 739 739 740 740 ret_t 741 cherokee_buffer_drop_end ding (cherokee_buffer_t *buffer, cuint_t num_chars)741 cherokee_buffer_drop_ending (cherokee_buffer_t *buffer, cuint_t num_chars) 742 742 { 743 743 int num; cherokee/trunk/cherokee/buffer.h
r1602 r1614 93 93 94 94 ret_t cherokee_buffer_move_to_begin (cherokee_buffer_t *buf, cuint_t pos); 95 ret_t cherokee_buffer_drop_end ding(cherokee_buffer_t *buf, cuint_t num_chars);95 ret_t cherokee_buffer_drop_ending (cherokee_buffer_t *buf, cuint_t num_chars); 96 96 ret_t cherokee_buffer_multiply (cherokee_buffer_t *buf, int num); 97 97 ret_t cherokee_buffer_swap_chars (cherokee_buffer_t *buf, char a, char b); … … 106 106 ret_t cherokee_buffer_ensure_size (cherokee_buffer_t *buf, size_t size); 107 107 108 int cherokee_buffer_is_end ding(cherokee_buffer_t *buf, char c);108 int cherokee_buffer_is_ending (cherokee_buffer_t *buf, char c); 109 109 char cherokee_buffer_end_char (cherokee_buffer_t *buf); 110 110 size_t cherokee_buffer_cnt_spn (cherokee_buffer_t *buf, cuint_t offset, char *str); cherokee/trunk/cherokee/connection.c
r1613 r1614 984 984 */ 985 985 if (cherokee_buffer_end_char (&conn->host) == '.') 986 cherokee_buffer_drop_end ding (&conn->host, 1);986 cherokee_buffer_drop_ending (&conn->host, 1); 987 987 988 988 return ret_ok; … … 1344 1344 char *end_username; 1345 1345 1346 /* Find user name end ding:1346 /* Find user name ending: 1347 1347 */ 1348 1348 begin = &conn->request.buf[2]; … … 1414 1414 1415 1415 cherokee_post_append (&conn->post, conn->incoming_header.buf + header_len, post_len); 1416 cherokee_buffer_drop_end ding (&conn->incoming_header, post_len);1416 cherokee_buffer_drop_ending (&conn->incoming_header, post_len); 1417 1417 } 1418 1418 cherokee/trunk/cherokee/connection_info.c
r1375 r1614 191 191 point = strchr (info->percent.buf, '.'); 192 192 if (point != NULL) 193 cherokee_buffer_drop_end ding (&info->percent, (info->percent.buf + info->percent.len) - (point + 2));193 cherokee_buffer_drop_ending (&info->percent, (info->percent.buf + info->percent.len) - (point + 2)); 194 194 } 195 195 … … 207 207 tmp = strchr (name.buf, '?'); 208 208 if (tmp != NULL) 209 cherokee_buffer_drop_end ding (&name, (name.buf + name.len) - tmp);209 cherokee_buffer_drop_ending (&name, (name.buf + name.len) - tmp); 210 210 211 211 tmp = strrchr (name.buf, '/'); cherokee/trunk/cherokee/downloader.c
r1441 r1614 275 275 /* Drop the header that has been sent 276 276 */ 277 cherokee_buffer_drop_end ding (buf, written);277 cherokee_buffer_drop_ending (buf, written); 278 278 if (cherokee_buffer_is_empty (buf)) { 279 279 return ret_ok; … … 353 353 cherokee_buffer_add (&downloader->body, downloader->reply_header.buf + len, body_chunk); 354 354 355 cherokee_buffer_drop_end ding (&downloader->reply_header, body_chunk);355 cherokee_buffer_drop_ending (&downloader->reply_header, body_chunk); 356 356 } 357 357 cherokee/trunk/cherokee/encoder_gzip.c
r1578 r1614 293 293 } 294 294 295 /* Add the end ding:295 /* Add the ending: 296 296 * +---+---+---+---+---+---+---+---+ 297 297 * | CRC32 | ISIZE | cherokee/trunk/cherokee/handler_cgi_base.c
r1611 r1614 662 662 663 663 pathinfo_len = end - p; 664 cherokee_buffer_drop_end ding (&conn->local_directory, pathinfo_len);664 cherokee_buffer_drop_ending (&conn->local_directory, pathinfo_len); 665 665 } 666 666 … … 708 708 /* Clean up the mess 709 709 */ 710 cherokee_buffer_drop_end ding (&conn->local_directory, (req_len - pathinfo_len) - 1);710 cherokee_buffer_drop_ending (&conn->local_directory, (req_len - pathinfo_len) - 1); 711 711 return ret; 712 712 } … … 774 774 if ((buffer->len > 4) && 775 775 (strncmp (CRLF_CRLF, buffer->buf + buffer->len - 4, 4) == 0)) { 776 cherokee_buffer_drop_end ding (buffer, 2);776 cherokee_buffer_drop_ending (buffer, 2); 777 777 } 778 778 … … 1046 1046 if (pathinfo_len > 0) { 1047 1047 cherokee_buffer_add (&conn->pathinfo, pathinfo, pathinfo_len); 1048 cherokee_buffer_drop_end ding (buf, pathinfo_len);1048 cherokee_buffer_drop_ending (buf, pathinfo_len); 1049 1049 } 1050 1050 cherokee/trunk/cherokee/handler_common.c
r1611 r1614 220 220 */ 221 221 cherokee_buffer_add (&conn->pathinfo, pathinfo, pathinfo_len); 222 cherokee_buffer_drop_end ding (&conn->request, pathinfo_len);222 cherokee_buffer_drop_ending (&conn->request, pathinfo_len); 223 223 224 224 /* Clean the local_directory, this connection is going … … 232 232 } 233 233 234 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len);234 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); 235 235 236 236 /* Is it a file? … … 320 320 321 321 cherokee_iocache_mmap_release (iocache, file); 322 cherokee_buffer_drop_end ding (&conn->local_directory, index_len);322 cherokee_buffer_drop_ending (&conn->local_directory, index_len); 323 323 324 324 TRACE (ENTRIES, "trying index '%s', exists %d\n", index, exists); … … 331 331 /* Add the index file to the request and clean up 332 332 */ 333 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len);333 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); 334 334 cherokee_buffer_add (&conn->request, index, index_len); 335 335 … … 340 340 /* If the dir hasn't a index file, it uses dirlist 341 341 */ 342 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len);342 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); 343 343 return cherokee_handler_dirlist_new (hdl, cnt, MODULE_PROPS(PROP_COMMON(props)->props_dirlist)); 344 344 } cherokee/trunk/cherokee/handler_dirlist.c
r1611 r1614 332 332 re = cherokee_lstat (path->buf, &n->stat); 333 333 if (re < 0) { 334 cherokee_buffer_drop_end ding (path, n->name_len);334 cherokee_buffer_drop_ending (path, n->name_len); 335 335 336 336 free (n); … … 340 340 /* Clean up and exit 341 341 */ 342 cherokee_buffer_drop_end ding (path, n->name_len);342 cherokee_buffer_drop_ending (path, n->name_len); 343 343 344 344 *ret_entry = n; … … 456 456 457 457 if ((cherokee_buffer_is_empty (&conn->request)) || 458 (!cherokee_buffer_is_end ding (&conn->request, '/')))458 (!cherokee_buffer_is_ending (&conn->request, '/'))) 459 459 { 460 460 /* Build the redirection address … … 616 616 */ 617 617 closedir(dir); 618 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len); /* 2 */618 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); /* 2 */ 619 619 620 620 /* Sort the file list … … 682 682 683 683 ret = cherokee_buffer_read_file (&dhdl->header, conn->local_directory.buf); 684 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len + filename_len); /* undo */684 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len + filename_len); /* undo */ 685 685 } else { 686 686 ret = cherokee_buffer_read_file (&dhdl->header, filename); cherokee/trunk/cherokee/handler_file.c
r1611 r1614 531 531 /* Undo the local directory 532 532 */ 533 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len);533 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); 534 534 return ret; 535 535 } cherokee/trunk/cherokee/handler_nn.c
r1131 r1614 133 133 cherokee_buffer_add (&conn->local_directory, conn->request.buf, conn->request.len); 134 134 stat_ret = stat (conn->local_directory.buf, &info); 135 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len);135 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); 136 136 137 137 /* Maybe the file/dir exists cherokee/trunk/cherokee/handler_redir.c
r1439 r1614 177 177 cherokee_buffer_clean (&conn->query_string); 178 178 cherokee_buffer_add (&conn->query_string, args, len); 179 cherokee_buffer_drop_end ding (&conn->request, len+1);179 cherokee_buffer_drop_ending (&conn->request, len+1); 180 180 } 181 181 … … 202 202 out: 203 203 if (! cherokee_buffer_is_empty (&conn->query_string)) 204 cherokee_buffer_drop_end ding (&conn->request, conn->query_string.len + 1);204 cherokee_buffer_drop_ending (&conn->request, conn->query_string.len + 1); 205 205 206 206 return ret; … … 319 319 { 320 320 int request_end; 321 char *request_end ding;321 char *request_ending; 322 322 cherokee_connection_t *conn = HANDLER_CONN(n); 323 323 … … 340 340 */ 341 341 request_end = (conn->request.len - conn->web_directory.len); 342 request_end ding = conn->request.buf + conn->web_directory.len;342 request_ending = conn->request.buf + conn->web_directory.len; 343 343 344 344 cherokee_buffer_ensure_size (&conn->redirect, request_end + HDL_REDIR_PROPS(n)->url.len +1); 345 345 cherokee_buffer_add_buffer (&conn->redirect, &HDL_REDIR_PROPS(n)->url); 346 cherokee_buffer_add (&conn->redirect, request_end ding, request_end);346 cherokee_buffer_add (&conn->redirect, request_ending, request_end); 347 347 348 348 conn->error_code = http_moved_permanently; cherokee/trunk/cherokee/main_tweak.c
r1439 r1614 179 179 } 180 180 181 cherokee_buffer_drop_end ding (&dirname, (dirname.buf + dirname.len) - (tmp + 1));181 cherokee_buffer_drop_ending (&dirname, (dirname.buf + dirname.len) - (tmp + 1)); 182 182 183 183 /* Read files … … 198 198 199 199 if (cherokee_buffer_cmp_buf (&dirname, logname)) { 200 cherokee_buffer_drop_end ding (&dirname, d_name_len);200 cherokee_buffer_drop_ending (&dirname, d_name_len); 201 201 continue; 202 202 } … … 210 210 } 211 211 212 cherokee_buffer_drop_end ding (&dirname, d_name_len);212 cherokee_buffer_drop_ending (&dirname, d_name_len); 213 213 } 214 214 cherokee/trunk/cherokee/plugin_loader.c
r1506 r1614 534 534 cherokee_avl_while (&loader->table, while_print_name, builtin, NULL, NULL); 535 535 if (builtin->len > 2) 536 cherokee_buffer_drop_end ding (builtin, 2);536 cherokee_buffer_drop_ending (builtin, 2); 537 537 538 538 return ret_ok; cherokee/trunk/cherokee/rule_request.c
r1482 r1614 93 93 restore: 94 94 if (! cherokee_buffer_is_empty (&conn->query_string)) { 95 cherokee_buffer_drop_end ding (&conn->request, conn->query_string.len + 1);95 cherokee_buffer_drop_ending (&conn->request, conn->query_string.len + 1); 96 96 } 97 97 cherokee/trunk/cherokee/url.c
r1131 r1614 170 170 /* .. and remove it 171 171 */ 172 ret = cherokee_buffer_drop_end ding (&url->host, strlen(port));172 ret = cherokee_buffer_drop_ending (&url->host, strlen(port)); 173 173 if (unlikely(ret < ret_ok)) return ret; 174 174 } cherokee/trunk/cherokee/util.c
r1611 r1614 1294 1294 cherokee_fix_dirpath (cherokee_buffer_t *buf) 1295 1295 { 1296 while (cherokee_buffer_is_end ding(buf, '/')) {1297 cherokee_buffer_drop_end ding (buf, 1);1298 } 1299 1300 return ret_ok; 1301 } 1296 while (cherokee_buffer_is_ending(buf, '/')) { 1297 cherokee_buffer_drop_ending (buf, 1); 1298 } 1299 1300 return ret_ok; 1301 } cherokee/trunk/cherokee/validator_htpasswd.c
r1439 r1614 263 263 264 264 if (conn->request.len > 0) 265 cherokee_buffer_drop_end ding (&conn->local_directory, conn->request.len-1); /* 1: remove */265 cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len-1); /* 1: remove */ 266 266 267 267 return ret; cherokee/trunk/cherokee/validator_plain.c
r1439 r1614 134 134 } 135 135 136 if (! cherokee_buffer_is_end ding(&file, '\n'))136 if (! cherokee_buffer_is_ending(&file, '\n')) 137 137 cherokee_buffer_add_str (&file, "\n"); 138 138