mirror of https://github.com/ipxe/ipxe.git
Protocol's get() method no longer takes ownership of the URI. HTTP is the
exception rather than the rule; we may as well keep things clean for other protocols.pull/1/head
parent
1f92c6b3e8
commit
afa752f5fb
|
@ -366,7 +366,6 @@ static void http_reap ( struct async *async ) {
|
||||||
struct http_request *http =
|
struct http_request *http =
|
||||||
container_of ( async, struct http_request, async );
|
container_of ( async, struct http_request, async );
|
||||||
|
|
||||||
free_uri ( http->uri );
|
|
||||||
free ( http );
|
free ( http );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,8 +384,6 @@ static struct async_operations http_async_operations = {
|
||||||
* @v buffer Buffer into which to download file
|
* @v buffer Buffer into which to download file
|
||||||
* @v parent Parent asynchronous operation
|
* @v parent Parent asynchronous operation
|
||||||
* @ret rc Return status code
|
* @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 ) {
|
int http_get ( struct uri *uri, struct buffer *buffer, struct async *parent ) {
|
||||||
struct http_request *http;
|
struct http_request *http;
|
||||||
|
|
|
@ -86,7 +86,6 @@ int fetch ( const char *uri_string, userptr_t *data, size_t *len ) {
|
||||||
async_init_orphan ( &async );
|
async_init_orphan ( &async );
|
||||||
if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
|
if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
|
||||||
goto err;
|
goto err;
|
||||||
uri = NULL;
|
|
||||||
async_wait ( &async, &rc, 1 );
|
async_wait ( &async, &rc, 1 );
|
||||||
if ( rc != 0 )
|
if ( rc != 0 )
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -98,7 +97,7 @@ int fetch ( const char *uri_string, userptr_t *data, size_t *len ) {
|
||||||
/* Release temporary resources. The ebuffer storage is now
|
/* Release temporary resources. The ebuffer storage is now
|
||||||
* owned by our caller, so we don't free it.
|
* owned by our caller, so we don't free it.
|
||||||
*/
|
*/
|
||||||
|
free_uri ( uri );
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
|
Loading…
Reference in New Issue