Skip to content

Commit

Permalink
git-svn-id: svn://cherokee-project.com/cherokee/trunk@1614 5dc97367-9…
Browse files Browse the repository at this point in the history
…7f1-0310-9951-d761b3857238
  • Loading branch information
alobbs committed Jul 7, 2008
1 parent adabd01 commit 51ed095
Show file tree
Hide file tree
Showing 19 changed files with 43 additions and 43 deletions.
4 changes: 2 additions & 2 deletions cherokee/buffer.c
Expand Up @@ -657,7 +657,7 @@ cherokee_buffer_prepend (cherokee_buffer_t *buf, char *txt, size_t size)


int
cherokee_buffer_is_endding (cherokee_buffer_t *buf, char c)
cherokee_buffer_is_ending (cherokee_buffer_t *buf, char c)
{
if (cherokee_buffer_is_empty(buf))
return 0;
Expand Down Expand Up @@ -738,7 +738,7 @@ cherokee_buffer_ensure_size (cherokee_buffer_t *buf, size_t size)


ret_t
cherokee_buffer_drop_endding (cherokee_buffer_t *buffer, cuint_t num_chars)
cherokee_buffer_drop_ending (cherokee_buffer_t *buffer, cuint_t num_chars)
{
int num;

Expand Down
4 changes: 2 additions & 2 deletions cherokee/buffer.h
Expand Up @@ -92,7 +92,7 @@ ret_t cherokee_buffer_add_chunked (cherokee_buffer_t *buf, char *txt, si
ret_t cherokee_buffer_add_buffer_chunked (cherokee_buffer_t *buf, cherokee_buffer_t *buf2);

ret_t cherokee_buffer_move_to_begin (cherokee_buffer_t *buf, cuint_t pos);
ret_t cherokee_buffer_drop_endding (cherokee_buffer_t *buf, cuint_t num_chars);
ret_t cherokee_buffer_drop_ending (cherokee_buffer_t *buf, cuint_t num_chars);
ret_t cherokee_buffer_multiply (cherokee_buffer_t *buf, int num);
ret_t cherokee_buffer_swap_chars (cherokee_buffer_t *buf, char a, char b);
ret_t cherokee_buffer_remove_dups (cherokee_buffer_t *buf, char c);
Expand All @@ -105,7 +105,7 @@ ret_t cherokee_buffer_trim (cherokee_buffer_t *buf);
ret_t cherokee_buffer_ensure_addlen (cherokee_buffer_t *buf, size_t alen);
ret_t cherokee_buffer_ensure_size (cherokee_buffer_t *buf, size_t size);

int cherokee_buffer_is_endding (cherokee_buffer_t *buf, char c);
int cherokee_buffer_is_ending (cherokee_buffer_t *buf, char c);
char cherokee_buffer_end_char (cherokee_buffer_t *buf);
size_t cherokee_buffer_cnt_spn (cherokee_buffer_t *buf, cuint_t offset, char *str);
size_t cherokee_buffer_cnt_cspn (cherokee_buffer_t *buf, cuint_t offset, char *str);
Expand Down
6 changes: 3 additions & 3 deletions cherokee/connection.c
Expand Up @@ -983,7 +983,7 @@ get_host (cherokee_connection_t *conn,
/* RFC-1034: Dot ending host names
*/
if (cherokee_buffer_end_char (&conn->host) == '.')
cherokee_buffer_drop_endding (&conn->host, 1);
cherokee_buffer_drop_ending (&conn->host, 1);

return ret_ok;
}
Expand Down Expand Up @@ -1343,7 +1343,7 @@ parse_userdir (cherokee_connection_t *conn)
char *begin;
char *end_username;

/* Find user name endding:
/* Find user name ending:
*/
begin = &conn->request.buf[2];

Expand Down Expand Up @@ -1413,7 +1413,7 @@ cherokee_connection_get_request (cherokee_connection_t *conn)
post_len = conn->incoming_header.len - header_len;

cherokee_post_append (&conn->post, conn->incoming_header.buf + header_len, post_len);
cherokee_buffer_drop_endding (&conn->incoming_header, post_len);
cherokee_buffer_drop_ending (&conn->incoming_header, post_len);
}

/* Copy the request and query string
Expand Down
4 changes: 2 additions & 2 deletions cherokee/connection_info.c
Expand Up @@ -190,7 +190,7 @@ cherokee_connection_info_fill_up (cherokee_connection_info_t *info, cherokee_con

point = strchr (info->percent.buf, '.');
if (point != NULL)
cherokee_buffer_drop_endding (&info->percent, (info->percent.buf + info->percent.len) - (point + 2));
cherokee_buffer_drop_ending (&info->percent, (info->percent.buf + info->percent.len) - (point + 2));
}

/* Local icon
Expand All @@ -206,7 +206,7 @@ cherokee_connection_info_fill_up (cherokee_connection_info_t *info, cherokee_con

tmp = strchr (name.buf, '?');
if (tmp != NULL)
cherokee_buffer_drop_endding (&name, (name.buf + name.len) - tmp);
cherokee_buffer_drop_ending (&name, (name.buf + name.len) - tmp);

tmp = strrchr (name.buf, '/');
if (tmp != NULL)
Expand Down
4 changes: 2 additions & 2 deletions cherokee/downloader.c
Expand Up @@ -274,7 +274,7 @@ downloader_send_buffer (cherokee_downloader_t *downloader, cherokee_buffer_t *bu
case ret_ok:
/* Drop the header that has been sent
*/
cherokee_buffer_drop_endding (buf, written);
cherokee_buffer_drop_ending (buf, written);
if (cherokee_buffer_is_empty (buf)) {
return ret_ok;
}
Expand Down Expand Up @@ -352,7 +352,7 @@ downloader_header_read (cherokee_downloader_t *downloader, cherokee_buffer_t *tm
downloader->info.body_recv += body_chunk;
cherokee_buffer_add (&downloader->body, downloader->reply_header.buf + len, body_chunk);

cherokee_buffer_drop_endding (&downloader->reply_header, body_chunk);
cherokee_buffer_drop_ending (&downloader->reply_header, body_chunk);
}

/* Try to read the "Content-Length" response header
Expand Down
2 changes: 1 addition & 1 deletion cherokee/encoder_gzip.c
Expand Up @@ -292,7 +292,7 @@ cherokee_encoder_gzip_flush (cherokee_encoder_gzip_t *encoder, cherokee_buffer_t
return ret;
}

/* Add the endding:
/* Add the ending:
* +---+---+---+---+---+---+---+---+
* | CRC32 | ISIZE |
* +---+---+---+---+---+---+---+---+
Expand Down
8 changes: 4 additions & 4 deletions cherokee/handler_cgi_base.c
Expand Up @@ -661,7 +661,7 @@ cherokee_handler_cgi_base_extract_path (cherokee_handler_cgi_base_t *cgi, cherok
cherokee_buffer_add (&conn->pathinfo, p, end - p);

pathinfo_len = end - p;
cherokee_buffer_drop_endding (&conn->local_directory, pathinfo_len);
cherokee_buffer_drop_ending (&conn->local_directory, pathinfo_len);
}

/* if (p <= begin) { */
Expand Down Expand Up @@ -707,7 +707,7 @@ cherokee_handler_cgi_base_extract_path (cherokee_handler_cgi_base_t *cgi, cherok
bye:
/* Clean up the mess
*/
cherokee_buffer_drop_endding (&conn->local_directory, (req_len - pathinfo_len) - 1);
cherokee_buffer_drop_ending (&conn->local_directory, (req_len - pathinfo_len) - 1);
return ret;
}

Expand Down Expand Up @@ -773,7 +773,7 @@ parse_header (cherokee_handler_cgi_base_t *cgi, cherokee_buffer_t *buffer)
*/
if ((buffer->len > 4) &&
(strncmp (CRLF_CRLF, buffer->buf + buffer->len - 4, 4) == 0)) {
cherokee_buffer_drop_endding (buffer, 2);
cherokee_buffer_drop_ending (buffer, 2);
}

TRACE (ENTRIES, "CGI header: %s\n", buffer->buf);
Expand Down Expand Up @@ -1045,7 +1045,7 @@ cherokee_handler_cgi_base_split_pathinfo (cherokee_handler_cgi_base_t *cgi,
*/
if (pathinfo_len > 0) {
cherokee_buffer_add (&conn->pathinfo, pathinfo, pathinfo_len);
cherokee_buffer_drop_endding (buf, pathinfo_len);
cherokee_buffer_drop_ending (buf, pathinfo_len);
}

TRACE (ENTRIES, "Pathinfo '%s'\n", conn->pathinfo.buf);
Expand Down
10 changes: 5 additions & 5 deletions cherokee/handler_common.c
Expand Up @@ -219,7 +219,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul
/* Copy the PathInfo and clean the request
*/
cherokee_buffer_add (&conn->pathinfo, pathinfo, pathinfo_len);
cherokee_buffer_drop_endding (&conn->request, pathinfo_len);
cherokee_buffer_drop_ending (&conn->request, pathinfo_len);

/* Clean the local_directory, this connection is going
* to restart the connection setup phase
Expand All @@ -231,7 +231,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul
return ret_eagain;
}

cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len);

/* Is it a file?
*/
Expand Down Expand Up @@ -319,7 +319,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul
is_dir = ((ret == ret_ok) && S_ISDIR(info->st_mode));

cherokee_iocache_mmap_release (iocache, file);
cherokee_buffer_drop_endding (&conn->local_directory, index_len);
cherokee_buffer_drop_ending (&conn->local_directory, index_len);

TRACE (ENTRIES, "trying index '%s', exists %d\n", index, exists);

Expand All @@ -330,7 +330,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul

/* Add the index file to the request and clean up
*/
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len);
cherokee_buffer_add (&conn->request, index, index_len);

TRACE_CONN(conn);
Expand All @@ -339,7 +339,7 @@ cherokee_handler_common_new (cherokee_handler_t **hdl, void *cnt, cherokee_modul

/* If the dir hasn't a index file, it uses dirlist
*/
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len);
return cherokee_handler_dirlist_new (hdl, cnt, MODULE_PROPS(PROP_COMMON(props)->props_dirlist));
}

Expand Down
10 changes: 5 additions & 5 deletions cherokee/handler_dirlist.c
Expand Up @@ -331,15 +331,15 @@ generate_file_entry (cherokee_handler_dirlist_t *dhdl, DIR *dir, cherokee_buffer
*/
re = cherokee_lstat (path->buf, &n->stat);
if (re < 0) {
cherokee_buffer_drop_endding (path, n->name_len);
cherokee_buffer_drop_ending (path, n->name_len);

free (n);
return ret_error;
}

/* Clean up and exit
*/
cherokee_buffer_drop_endding (path, n->name_len);
cherokee_buffer_drop_ending (path, n->name_len);

*ret_entry = n;
return ret_ok;
Expand Down Expand Up @@ -455,7 +455,7 @@ check_request_finish_with_slash (cherokee_handler_dirlist_t *dhdl)
cherokee_connection_t *conn = HANDLER_CONN(dhdl);

if ((cherokee_buffer_is_empty (&conn->request)) ||
(!cherokee_buffer_is_endding (&conn->request, '/')))
(!cherokee_buffer_is_ending (&conn->request, '/')))
{
/* Build the redirection address
*/
Expand Down Expand Up @@ -615,7 +615,7 @@ build_file_list (cherokee_handler_dirlist_t *dhdl)
/* Clean
*/
closedir(dir);
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len); /* 2 */
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len); /* 2 */

/* Sort the file list
*/
Expand Down Expand Up @@ -681,7 +681,7 @@ read_notice_file (cherokee_handler_dirlist_t *dhdl)
cherokee_buffer_add (&conn->local_directory, filename, filename_len);

ret = cherokee_buffer_read_file (&dhdl->header, conn->local_directory.buf);
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len + filename_len); /* undo */
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len + filename_len); /* undo */
} else {
ret = cherokee_buffer_read_file (&dhdl->header, filename);
}
Expand Down
2 changes: 1 addition & 1 deletion cherokee/handler_file.c
Expand Up @@ -530,7 +530,7 @@ cherokee_handler_file_init (cherokee_handler_file_t *fhdl)

/* Undo the local directory
*/
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len);
return ret;
}

Expand Down
2 changes: 1 addition & 1 deletion cherokee/handler_nn.c
Expand Up @@ -132,7 +132,7 @@ cherokee_handler_nn_new (cherokee_handler_t **hdl, void *cnt, cherokee_module_pr

cherokee_buffer_add (&conn->local_directory, conn->request.buf, conn->request.len);
stat_ret = stat (conn->local_directory.buf, &info);
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len);
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len);

/* Maybe the file/dir exists
*/
Expand Down
10 changes: 5 additions & 5 deletions cherokee/handler_redir.c
Expand Up @@ -176,7 +176,7 @@ match_and_substitute (cherokee_handler_redir_t *n)
if (len > 0) {
cherokee_buffer_clean (&conn->query_string);
cherokee_buffer_add (&conn->query_string, args, len);
cherokee_buffer_drop_endding (&conn->request, len+1);
cherokee_buffer_drop_ending (&conn->request, len+1);
}

TRACE (ENTRIES, "Hidden redirect to: request=\"%s\" query_string=\"%s\"\n",
Expand All @@ -201,7 +201,7 @@ match_and_substitute (cherokee_handler_redir_t *n)

out:
if (! cherokee_buffer_is_empty (&conn->query_string))
cherokee_buffer_drop_endding (&conn->request, conn->query_string.len + 1);
cherokee_buffer_drop_ending (&conn->request, conn->query_string.len + 1);

return ret;
}
Expand Down Expand Up @@ -318,7 +318,7 @@ ret_t
cherokee_handler_redir_init (cherokee_handler_redir_t *n)
{
int request_end;
char *request_endding;
char *request_ending;
cherokee_connection_t *conn = HANDLER_CONN(n);

/* Maybe ::new -> match_and_substitute() has already set
Expand All @@ -339,11 +339,11 @@ cherokee_handler_redir_init (cherokee_handler_redir_t *n)
/* Try with URL directive
*/
request_end = (conn->request.len - conn->web_directory.len);
request_endding = conn->request.buf + conn->web_directory.len;
request_ending = conn->request.buf + conn->web_directory.len;

cherokee_buffer_ensure_size (&conn->redirect, request_end + HDL_REDIR_PROPS(n)->url.len +1);
cherokee_buffer_add_buffer (&conn->redirect, &HDL_REDIR_PROPS(n)->url);
cherokee_buffer_add (&conn->redirect, request_endding, request_end);
cherokee_buffer_add (&conn->redirect, request_ending, request_end);

conn->error_code = http_moved_permanently;
return ret_ok;
Expand Down
6 changes: 3 additions & 3 deletions cherokee/main_tweak.c
Expand Up @@ -178,7 +178,7 @@ look_for_logname (cherokee_buffer_t *logfile, cherokee_buffer_t *logname)
goto error;
}

cherokee_buffer_drop_endding (&dirname, (dirname.buf + dirname.len) - (tmp + 1));
cherokee_buffer_drop_ending (&dirname, (dirname.buf + dirname.len) - (tmp + 1));

/* Read files
*/
Expand All @@ -197,7 +197,7 @@ look_for_logname (cherokee_buffer_t *logfile, cherokee_buffer_t *logname)
cherokee_buffer_add (&dirname, file->d_name, d_name_len);

if (cherokee_buffer_cmp_buf (&dirname, logname)) {
cherokee_buffer_drop_endding (&dirname, d_name_len);
cherokee_buffer_drop_ending (&dirname, d_name_len);
continue;
}

Expand All @@ -209,7 +209,7 @@ look_for_logname (cherokee_buffer_t *logfile, cherokee_buffer_t *logname)
max = val;
}

cherokee_buffer_drop_endding (&dirname, d_name_len);
cherokee_buffer_drop_ending (&dirname, d_name_len);
}

/* Build the new filename
Expand Down
2 changes: 1 addition & 1 deletion cherokee/plugin_loader.c
Expand Up @@ -533,7 +533,7 @@ cherokee_plugin_loader_get_mods_info (cherokee_plugin_loader_t *loader,
*/
cherokee_avl_while (&loader->table, while_print_name, builtin, NULL, NULL);
if (builtin->len > 2)
cherokee_buffer_drop_endding (builtin, 2);
cherokee_buffer_drop_ending (builtin, 2);

return ret_ok;
}
2 changes: 1 addition & 1 deletion cherokee/rule_request.c
Expand Up @@ -92,7 +92,7 @@ match (cherokee_rule_request_t *rule, cherokee_connection_t *conn)

restore:
if (! cherokee_buffer_is_empty (&conn->query_string)) {
cherokee_buffer_drop_endding (&conn->request, conn->query_string.len + 1);
cherokee_buffer_drop_ending (&conn->request, conn->query_string.len + 1);
}

return ret;
Expand Down
2 changes: 1 addition & 1 deletion cherokee/url.c
Expand Up @@ -169,7 +169,7 @@ cherokee_url_parse_guts (cherokee_url_t *url,

/* .. and remove it
*/
ret = cherokee_buffer_drop_endding (&url->host, strlen(port));
ret = cherokee_buffer_drop_ending (&url->host, strlen(port));
if (unlikely(ret < ret_ok)) return ret;
}

Expand Down
4 changes: 2 additions & 2 deletions cherokee/util.c
Expand Up @@ -1293,8 +1293,8 @@ cherokee_print_wrapped (cherokee_buffer_t *buffer)
ret_t
cherokee_fix_dirpath (cherokee_buffer_t *buf)
{
while (cherokee_buffer_is_endding(buf, '/')) {
cherokee_buffer_drop_endding (buf, 1);
while (cherokee_buffer_is_ending(buf, '/')) {
cherokee_buffer_drop_ending (buf, 1);
}

return ret_ok;
Expand Down
2 changes: 1 addition & 1 deletion cherokee/validator_htpasswd.c
Expand Up @@ -262,7 +262,7 @@ request_isnt_passwd_file (cherokee_validator_htpasswd_t *htpasswd, cherokee_conn
}

if (conn->request.len > 0)
cherokee_buffer_drop_endding (&conn->local_directory, conn->request.len-1); /* 1: remove */
cherokee_buffer_drop_ending (&conn->local_directory, conn->request.len-1); /* 1: remove */

return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion cherokee/validator_plain.c
Expand Up @@ -133,7 +133,7 @@ cherokee_validator_plain_check (cherokee_validator_plain_t *plain, cherokee_conn
goto out;
}

if (! cherokee_buffer_is_endding(&file, '\n'))
if (! cherokee_buffer_is_ending(&file, '\n'))
cherokee_buffer_add_str (&file, "\n");

p = file.buf;
Expand Down

0 comments on commit 51ed095

Please sign in to comment.