Procházet zdrojové kódy

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 před 18 roky
rodič
revize
afa752f5fb
2 změnil soubory, kde provedl 1 přidání a 5 odebrání
  1. 0
    3
      src/net/tcp/http.c
  2. 1
    2
      src/usr/fetch.c

+ 0
- 3
src/net/tcp/http.c Zobrazit soubor

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

+ 1
- 2
src/usr/fetch.c Zobrazit soubor

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

Načítá se…
Zrušit
Uložit