Browse Source

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.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
afa752f5fb
2 changed files with 1 additions and 5 deletions
  1. 0
    3
      src/net/tcp/http.c
  2. 1
    2
      src/usr/fetch.c

+ 0
- 3
src/net/tcp/http.c View File

366
 	struct http_request *http =
366
 	struct http_request *http =
367
 		container_of ( async, struct http_request, async );
367
 		container_of ( async, struct http_request, async );
368
 
368
 
369
-	free_uri ( http->uri );
370
 	free ( http );
369
 	free ( http );
371
 }
370
 }
372
 
371
 
385
  * @v buffer		Buffer into which to download file
384
  * @v buffer		Buffer into which to download file
386
  * @v parent		Parent asynchronous operation
385
  * @v parent		Parent asynchronous operation
387
  * @ret rc		Return status code
386
  * @ret rc		Return status code
388
- *
389
- * If it returns success, this function takes ownership of the URI.
390
  */
387
  */
391
 int http_get ( struct uri *uri, struct buffer *buffer, struct async *parent ) {
388
 int http_get ( struct uri *uri, struct buffer *buffer, struct async *parent ) {
392
 	struct http_request *http;
389
 	struct http_request *http;

+ 1
- 2
src/usr/fetch.c View File

86
 	async_init_orphan ( &async );
86
 	async_init_orphan ( &async );
87
 	if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
87
 	if ( ( rc = download ( uri, &buffer, &async ) ) != 0 )
88
 		goto err;
88
 		goto err;
89
-	uri = NULL;
90
 	async_wait ( &async, &rc, 1 );
89
 	async_wait ( &async, &rc, 1 );
91
 	if ( rc != 0 )
90
 	if ( rc != 0 )
92
 		goto err;
91
 		goto err;
98
 	/* Release temporary resources.  The ebuffer storage is now
97
 	/* Release temporary resources.  The ebuffer storage is now
99
 	 * owned by our caller, so we don't free it.
98
 	 * owned by our caller, so we don't free it.
100
 	 */
99
 	 */
101
-
100
+	free_uri ( uri );
102
 	return 0;
101
 	return 0;
103
 
102
 
104
  err:
103
  err:

Loading…
Cancel
Save