Commit e385df0b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

urlmon: Update existing session if user agent changes.

parent 552d9f36
......@@ -302,6 +302,12 @@ HINTERNET get_internet_session(IInternetBindInfo *bind_info)
return internet_session;
}
void update_user_agent(WCHAR *user_agent)
{
if(internet_session)
InternetSetOptionW(internet_session, INTERNET_OPTION_USER_AGENT, user_agent, strlenW(user_agent));
}
HRESULT protocol_start(Protocol *protocol, IInternetProtocol *prot, IUri *uri,
IInternetProtocolSink *protocol_sink, IInternetBindInfo *bind_info)
{
......
......@@ -718,6 +718,7 @@ HRESULT WINAPI UrlMkSetSessionOption(DWORD dwOption, LPVOID pBuffer, DWORD dwBuf
heap_free(user_agent);
user_agent = new_user_agent;
update_user_agent(user_agent);
LeaveCriticalSection(&session_cs);
break;
......
......@@ -72,7 +72,8 @@ IInternetProtocol *get_mime_filter(LPCWSTR) DECLSPEC_HIDDEN;
BOOL is_registered_protocol(LPCWSTR) DECLSPEC_HIDDEN;
HRESULT register_namespace(IClassFactory*,REFIID,LPCWSTR,BOOL) DECLSPEC_HIDDEN;
HINTERNET get_internet_session(IInternetBindInfo*) DECLSPEC_HIDDEN;
LPWSTR get_useragent(void) DECLSPEC_HIDDEN;
WCHAR *get_useragent(void) DECLSPEC_HIDDEN;
void update_user_agent(WCHAR*) DECLSPEC_HIDDEN;
void free_session(void) DECLSPEC_HIDDEN;
HRESULT bind_to_storage(IUri*,IBindCtx*,REFIID,void**) DECLSPEC_HIDDEN;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment