diff options
| author | Aris Adamantiadis <aris@0xbadc0de.be> | 2010-03-01 18:11:40 +0100 |
|---|---|---|
| committer | Andreas Schneider <mail@cynapses.org> | 2010-03-06 12:28:56 +0100 |
| commit | 9dd86859e8582eefc958a14ba4787c2488730edc (patch) | |
| tree | c534e7de3c2085b379bd8dddd573bbad8be3352b /libssh | |
| parent | 810fbfb62089e299e913eef052ca8e3e2be9d090 (diff) | |
renamed ssh_list_get_head to ssh_list_pop_head
Diffstat (limited to 'libssh')
| -rw-r--r-- | libssh/misc.c | 9 | ||||
| -rw-r--r-- | libssh/server.c | 4 | ||||
| -rw-r--r-- | libssh/session.c | 2 |
3 files changed, 11 insertions, 4 deletions
diff --git a/libssh/misc.c b/libssh/misc.c index f64c395a..a86a163b 100644 --- a/libssh/misc.c +++ b/libssh/misc.c @@ -261,7 +261,14 @@ void ssh_list_remove(struct ssh_list *list, struct ssh_iterator *iterator){ SAFE_FREE(iterator); } -const void *_ssh_list_get_head(struct ssh_list *list){ +/** @internal + * @brief Removes the top element of the list and returns the data value attached + * to it + * @param list the ssh_list + * @returns pointer to the element being stored in head, or + * NULL if the list is empty. + */ +const void *_ssh_list_pop_head(struct ssh_list *list){ struct ssh_iterator *iterator=list->root; const void *data; if(!list->root) diff --git a/libssh/server.c b/libssh/server.c index 79244edb..f5258c69 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -871,7 +871,7 @@ int ssh_execute_message_callbacks(ssh_session session){ if(!session->ssh_message_list) return SSH_OK; if(session->ssh_message_callback){ - while((msg=ssh_list_get_head(ssh_message , session->ssh_message_list)) != NULL){ + while((msg=ssh_list_pop_head(ssh_message , session->ssh_message_list)) != NULL){ ret=session->ssh_message_callback(session,msg); if(ret==1){ ret = ssh_message_reply_default(msg); @@ -880,7 +880,7 @@ int ssh_execute_message_callbacks(ssh_session session){ } } } else { - while((msg=ssh_list_get_head(ssh_message , session->ssh_message_list)) != NULL){ + while((msg=ssh_list_pop_head(ssh_message , session->ssh_message_list)) != NULL){ ret = ssh_message_reply_default(msg); if(ret != SSH_OK) return ret; diff --git a/libssh/session.c b/libssh/session.c index b2c0368e..f1c36b80 100644 --- a/libssh/session.c +++ b/libssh/session.c @@ -155,7 +155,7 @@ void ssh_free(ssh_session session) { privatekey_free(session->rsa_key); if(session->ssh_message_list){ ssh_message msg; - while((msg=ssh_list_get_head(ssh_message ,session->ssh_message_list)) + while((msg=ssh_list_pop_head(ssh_message ,session->ssh_message_list)) != NULL){ ssh_message_free(msg); } |
