Mercurial > audlegacy-plugins
diff src/curl/curl.c @ 521:72515e5313cf trunk
[svn] - refinements for getc/ungetc in curl
author | giacomo |
---|---|
date | Mon, 22 Jan 2007 12:21:31 -0800 |
parents | bbc597d9875d |
children | c00fd2a0736f |
line wrap: on
line diff
--- a/src/curl/curl.c Mon Jan 22 10:36:50 2007 -0800 +++ b/src/curl/curl.c Mon Jan 22 12:21:31 2007 -0800 @@ -588,6 +588,7 @@ uc = GPOINTER_TO_INT(handle->stream_stack->data); handle->stream_stack = g_slist_delete_link( handle->stream_stack , handle->stream_stack ); memcpy( ptr + ret , &uc , 1 ); + handle->rd_abs++; ret++; } } @@ -649,6 +650,7 @@ { uc = GPOINTER_TO_INT(handle->stream_stack->data); handle->stream_stack = g_slist_delete_link( handle->stream_stack , handle->stream_stack ); + handle->rd_abs++; return uc; } else if (curl_vfs_fread_impl(&uc, 1, 1, stream) != 1) @@ -665,7 +667,10 @@ handle->stream_stack = g_slist_prepend( handle->stream_stack , GINT_TO_POINTER(c) ); if ( handle->stream_stack != NULL ) + { + handle->rd_abs--; return c; + } else return EOF; } @@ -759,20 +764,14 @@ curl_vfs_ftell_impl(VFSFile * file) { CurlHandle *handle = file->handle; - if ( handle->stream_stack != NULL ) - return handle->rd_abs - g_slist_length( handle->stream_stack ); - else - return handle->rd_abs; + return handle->rd_abs; } gboolean curl_vfs_feof_impl(VFSFile * file) { CurlHandle *handle = file->handle; - if ( handle->stream_stack != NULL ) - return (handle->rd_abs - g_slist_length( handle->stream_stack )) == handle->length; - else - return handle->rd_abs == handle->length; + return handle->rd_abs == handle->length; } gint