Skip to content

Fix a bug that oauth_bearer is deallocated when we re-use a connection#4824

Closed
naost3rn wants to merge 5 commits intocurl:masterfrom
naost3rn:fix_oauth_bearer
Closed

Fix a bug that oauth_bearer is deallocated when we re-use a connection#4824
naost3rn wants to merge 5 commits intocurl:masterfrom
naost3rn:fix_oauth_bearer

Conversation

@naost3rn
Copy link
Copy Markdown
Contributor

get the Bearer token from the old_conn struct since it may be new for this request even when we re-use an existing connection

@bagder
Copy link
Copy Markdown
Member

bagder commented Jan 16, 2020

This made me think. Why do we store the 'bearer' in the connection anyway? Isn't the bearer rather per-transfer? I.e shouldn't it be moved from struct connectdata to struct Curl_easy ?

Copy link
Copy Markdown
Member

@bagder bagder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@bagder
Copy link
Copy Markdown
Member

bagder commented Jan 20, 2020

The disable verbose build in travis failed:

I presume you need to make 'data' available in that function unconditionally.

http.c: In function ‘output_auth_headers’:
http.c:710:19: error: ‘data’ undeclared (first use in this function); did you mean ‘path’?
     if((!proxy && data->set.str[STRING_BEARER] &&
                   ^~~~
                   path

get the bearer information from the old_conn struct since
it may be new for this request even when we re-use an existing connection
…onnection"

This reverts commit a5187f8163597be710ccf288c96cf6e904adc0c9.
remove oauth_bearer from struct connectdata and get the Bearer token from struct Curl_easy
@bagder
Copy link
Copy Markdown
Member

bagder commented Jan 21, 2020

Thanks!

@bagder bagder closed this in dea17b5 Jan 21, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Development

Successfully merging this pull request may close these issues.

2 participants