struct http_request *http =
container_of ( async, struct http_request, async );
- free_uri ( http->uri );
free ( http );
}
* @v buffer Buffer into which to download file
* @v parent Parent asynchronous operation
* @ret rc Return status code
- *
- * If it returns success, this function takes ownership of the URI.
*/
int http_get ( struct uri *uri, struct buffer *buffer, struct async *parent ) {
struct http_request *http;
async_init_orphan ( &async );
if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
goto err;
- uri = NULL;
async_wait ( &async, &rc, 1 );
if ( rc != 0 )
goto err;
/* Release temporary resources. The ebuffer storage is now
* owned by our caller, so we don't free it.
*/
-
+ free_uri ( uri );
return 0;
err: