aboutsummaryrefslogtreecommitdiff
path: root/libssh/buffer.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2005-10-26 19:13:57 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2005-10-26 19:13:57 +0000
commit7b416e5c520c4dea21e242733d64672f304fdbd3 (patch)
tree1322367d187ac4521e45e6c8e7358e2245b2e02b /libssh/buffer.c
parentc53b6b907ce7ccaf720777c18eed3eea46807bb7 (diff)
downloadlibssh-7b416e5c520c4dea21e242733d64672f304fdbd3.tar.gz
libssh-7b416e5c520c4dea21e242733d64672f304fdbd3.tar.xz
libssh-7b416e5c520c4dea21e242733d64672f304fdbd3.zip
resolved the channel hangs on exit issue (moved EOF to read events and removed it from exceptions).
resolved stupid cute & paste error in init_md5() git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@47 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/buffer.c')
-rw-r--r--libssh/buffer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libssh/buffer.c b/libssh/buffer.c
index 9cdf859..ade6f02 100644
--- a/libssh/buffer.c
+++ b/libssh/buffer.c
@@ -31,10 +31,12 @@ BUFFER *buffer_new(){
}
void buffer_free(BUFFER *buffer){
+// printf("buffer %p : free(%p);\n",buffer,buffer->data);
if(buffer->data){
memset(buffer->data,0,buffer->allocated); /* burn the data */
free(buffer->data);
}
+ memset(buffer,'x',sizeof (*buffer));
free(buffer);
}
@@ -46,7 +48,9 @@ void buffer_reinit(BUFFER *buffer){
static void realloc_buffer(BUFFER *buffer,int needed){
needed=(needed+0x7f) & ~0x7f;
+// printf("buffer %p : realloc(%x,%d)=",buffer,buffer->data,needed);
buffer->data=realloc(buffer->data,needed);
+// printf("%p\n",buffer->data);
buffer->allocated=needed;
}