Changeset c42e8b9 for lib


Ignore:
Timestamp:
2010-04-26T22:40:11Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
78a2f1e
Parents:
713d611
Message:

OAuth, it lives!

Location:
lib
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • lib/oauth.c

    r713d611 rc42e8b9  
    302302        }
    303303       
     304        st->stage = OAUTH_REQUEST_TOKEN;
    304305        st->func( st );
    305306}
     
    322323       
    323324        if( req->status_code == 200 )
    324                 st->access_token = g_strdup( req->reply_body );
    325        
     325        {
     326                GSList *params;
     327                const char *token, *token_secret;
     328               
     329                oauth_params_parse( &params, req->reply_body );
     330                token = oauth_params_get( &params, "oauth_token" );
     331                token_secret = oauth_params_get( &params, "oauth_token_secret" );
     332                st->access_token = g_strdup_printf(
     333                        "oauth_token=%s&oauth_token_secret=%s", token, token_secret );
     334                oauth_params_free( &params );
     335        }
     336       
     337        st->stage = OAUTH_ACCESS_TOKEN;
    326338        st->func( st );
    327339}
  • lib/oauth.h

    r713d611 rc42e8b9  
    2727typedef void (*oauth_cb)( struct oauth_info * );
    2828
     29typedef enum
     30{
     31        OAUTH_INIT,
     32        OAUTH_REQUEST_TOKEN,
     33        OAUTH_ACCESS_TOKEN,
     34} oauth_stage_t;
     35
    2936struct oauth_info
    3037{
     38        oauth_stage_t stage;
     39       
    3140        oauth_cb func;
    3241        void *data;
Note: See TracChangeset for help on using the changeset viewer.