diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/oauth.c | 11 | ||||
-rw-r--r-- | lib/oauth.h | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/oauth.c b/lib/oauth.c index 57dd10f8..14e7797c 100644 --- a/lib/oauth.c +++ b/lib/oauth.c @@ -228,6 +228,7 @@ void oauth_info_free( struct oauth_info *info ) g_free( info->request_token ); g_free( info->token ); g_free( info->token_secret ); + oauth_params_free( &info->params ); g_free( info ); } } @@ -353,12 +354,9 @@ static void oauth_access_token_done( struct http_request *req ) if( req->status_code == 200 ) { - GSList *params = NULL; - - oauth_params_parse( ¶ms, req->reply_body ); - st->token = g_strdup( oauth_params_get( ¶ms, "oauth_token" ) ); - st->token_secret = g_strdup( oauth_params_get( ¶ms, "oauth_token_secret" ) ); - oauth_params_free( ¶ms ); + oauth_params_parse( &st->params, req->reply_body ); + st->token = g_strdup( oauth_params_get( &st->params, "oauth_token" ) ); + st->token_secret = g_strdup( oauth_params_get( &st->params, "oauth_token_secret" ) ); } st->stage = OAUTH_ACCESS_TOKEN; @@ -369,6 +367,7 @@ static void oauth_access_token_done( struct http_request *req ) st->auth_url = NULL; g_free( st->request_token ); st->request_token = NULL; + oauth_params_free( &st->params ); } } diff --git a/lib/oauth.h b/lib/oauth.h index 5dfe0ae5..8270a545 100644 --- a/lib/oauth.h +++ b/lib/oauth.h @@ -51,6 +51,7 @@ struct oauth_info char *token; char *token_secret; + GSList *params; }; struct oauth_service @@ -88,3 +89,6 @@ void oauth_info_free( struct oauth_info *info ); /* Convert to and back from strings, for easier saving. */ char *oauth_to_string( struct oauth_info *oi ); struct oauth_info *oauth_from_string( char *in, const struct oauth_service *sp ); + +/* For reading misc. data. */ +const char *oauth_params_get( GSList **params, const char *key ); |