Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
94c02fef
Commit
94c02fef
authored
Apr 14, 2003
by
Dominik Strasser
Committed by
Alexandre Julliard
Apr 14, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partially implement proxy support.
parent
041a8de2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
5 deletions
+70
-5
Makefile.in
dlls/wininet/Makefile.in
+1
-1
http.c
dlls/wininet/http.c
+43
-2
internet.c
dlls/wininet/internet.c
+26
-2
No files found.
dlls/wininet/Makefile.in
View file @
94c02fef
...
...
@@ -4,7 +4,7 @@ TOPOBJDIR = ../..
SRCDIR
=
@srcdir@
VPATH
=
@srcdir@
MODULE
=
wininet.dll
IMPORTS
=
shlwapi user32 kernel32
IMPORTS
=
shlwapi user32
advapi32
kernel32
EXTRALIBS
=
$(LIBUNICODE)
LDDLLFLAGS
=
@LDDLLFLAGS@
...
...
dlls/wininet/http.c
View file @
94c02fef
...
...
@@ -382,6 +382,40 @@ HINTERNET WINAPI HTTP_HttpOpenRequestA(HINTERNET hHttpSession,
InternetCrackUrlA
(
lpszReferrer
,
0
,
0
,
&
UrlComponents
);
if
(
strlen
(
UrlComponents
.
lpszHostName
))
lpwhr
->
lpszHostName
=
HTTP_strdup
(
UrlComponents
.
lpszHostName
);
}
else
if
(
NULL
!=
hIC
->
lpszProxy
&&
hIC
->
lpszProxy
[
0
]
!=
0
)
{
char
buf
[
MAXHOSTNAME
];
char
proxy
[
MAXHOSTNAME
+
13
];
/* 13 == "http://" + sizeof(port#) + ":/\0" */
URL_COMPONENTSA
UrlComponents
;
UrlComponents
.
lpszExtraInfo
=
NULL
;
UrlComponents
.
lpszPassword
=
NULL
;
UrlComponents
.
lpszScheme
=
NULL
;
UrlComponents
.
lpszUrlPath
=
NULL
;
UrlComponents
.
lpszUserName
=
NULL
;
UrlComponents
.
lpszHostName
=
buf
;
UrlComponents
.
dwHostNameLength
=
MAXHOSTNAME
;
sprintf
(
proxy
,
"http://%s/"
,
hIC
->
lpszProxy
);
InternetCrackUrlA
(
proxy
,
0
,
0
,
&
UrlComponents
);
if
(
strlen
(
UrlComponents
.
lpszHostName
))
{
/* for constant 13 see above */
char
*
url
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
lpwhr
->
lpszHostName
)
+
strlen
(
lpwhr
->
lpszPath
)
+
13
);
if
(
UrlComponents
.
nPort
==
INTERNET_INVALID_PORT_NUMBER
)
UrlComponents
.
nPort
=
INTERNET_DEFAULT_HTTP_PORT
;
if
(
lpwhr
->
lpszHostName
!=
0
)
{
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszHostName
);
lpwhr
->
lpszHostName
=
0
;
}
sprintf
(
url
,
"http://%s:%d/%s"
,
lpwhs
->
lpszServerName
,
lpwhs
->
nServerPort
,
lpwhr
->
lpszPath
);
if
(
lpwhr
->
lpszPath
)
HeapFree
(
GetProcessHeap
(),
0
,
lpwhr
->
lpszPath
);
lpwhr
->
lpszPath
=
url
;
/* FIXME: Do I have to free lpwhs->lpszServerName here ? */
lpwhs
->
lpszServerName
=
HTTP_strdup
(
UrlComponents
.
lpszHostName
);
lpwhs
->
nServerPort
=
UrlComponents
.
nPort
;
}
}
else
{
lpwhr
->
lpszHostName
=
HTTP_strdup
(
lpwhs
->
lpszServerName
);
}
...
...
@@ -910,7 +944,8 @@ BOOL WINAPI HTTP_HttpSendRequestA(HINTERNET hHttpRequest, LPCSTR lpszHeaders,
if
(
NULL
==
lpwhr
->
lpszPath
)
lpwhr
->
lpszPath
=
HTTP_strdup
(
"/"
);
if
(
lpwhr
->
lpszPath
[
0
]
!=
'/'
)
/* not an absolute path ?? --> fix it !! */
if
(
strncmp
(
lpwhr
->
lpszPath
,
"http://"
,
sizeof
(
"http://"
)
-
1
)
!=
0
&&
lpwhr
->
lpszPath
[
0
]
!=
'/'
)
/* not an absolute path ?? --> fix it !! */
{
char
*
fixurl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
lpwhr
->
lpszPath
)
+
2
);
*
fixurl
=
'/'
;
...
...
@@ -1100,7 +1135,7 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
hIC
=
(
LPWININETAPPINFOA
)
hInternet
;
hIC
->
hdr
.
dwContext
=
dwContext
;
lpwhs
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
WININETHTTPSESSIONA
));
if
(
NULL
==
lpwhs
)
{
...
...
@@ -1119,6 +1154,12 @@ HINTERNET HTTP_Connect(HINTERNET hInternet, LPCSTR lpszServerName,
lpwhs
->
hdr
.
lpwhparent
=
(
LPWININETHANDLEHEADER
)
hInternet
;
lpwhs
->
hdr
.
dwFlags
=
dwFlags
;
lpwhs
->
hdr
.
dwContext
=
dwContext
;
if
(
hIC
->
lpszProxy
&&
hIC
->
dwAccessType
==
INTERNET_OPEN_TYPE_PROXY
)
{
if
(
strchr
(
hIC
->
lpszProxy
,
' '
))
FIXME
(
"Several proxies not implemented.
\n
"
);
if
(
hIC
->
lpszProxyBypass
)
FIXME
(
"Proxy bypass is ignored.
\n
"
);
}
if
(
NULL
!=
lpszServerName
)
lpwhs
->
lpszServerName
=
HTTP_strdup
(
lpszServerName
);
if
(
NULL
!=
lpszUserName
)
...
...
dlls/wininet/internet.c
View file @
94c02fef
...
...
@@ -224,7 +224,31 @@ HINTERNET WINAPI InternetOpenA(LPCSTR lpszAgent, DWORD dwAccessType,
if
((
lpwai
->
lpszAgent
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
lpszAgent
)
+
1
)))
strcpy
(
lpwai
->
lpszAgent
,
lpszAgent
);
}
if
(
NULL
!=
lpszProxy
)
if
(
dwAccessType
==
INTERNET_OPEN_TYPE_PRECONFIG
)
{
HKEY
key
;
if
(
!
RegOpenKeyA
(
HKEY_CURRENT_USER
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Internet Settings"
,
&
key
))
{
DWORD
keytype
,
len
,
enabled
;
RegQueryValueExA
(
key
,
"ProxyEnable"
,
NULL
,
NULL
,
(
BYTE
*
)
&
enabled
,
NULL
);
if
(
enabled
)
{
if
(
!
RegQueryValueExA
(
key
,
"ProxyServer"
,
NULL
,
&
keytype
,
NULL
,
&
len
)
&&
len
&&
keytype
==
REG_SZ
)
{
lpwai
->
lpszProxy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
len
+
1
);
RegQueryValueExA
(
key
,
"ProxyServer"
,
NULL
,
&
keytype
,
(
BYTE
*
)
lpwai
->
lpszProxy
,
&
len
);
TRACE
(
"Proxy = %s
\n
"
,
lpwai
->
lpszProxy
);
dwAccessType
=
INTERNET_OPEN_TYPE_PROXY
;
}
}
else
{
TRACE
(
"Proxy is not enabled.
\n
"
);
}
RegCloseKey
(
key
);
}
}
else
if
(
NULL
!=
lpszProxy
)
{
if
((
lpwai
->
lpszProxy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
strlen
(
lpszProxy
)
+
1
)))
strcpy
(
lpwai
->
lpszProxy
,
lpszProxy
);
...
...
@@ -641,7 +665,7 @@ BOOL WINAPI InternetCloseHandle(HINTERNET hInternet)
/***********************************************************************
* ConvertUrlComponentValue (Internal)
*
* Helper function for InternetCrackUrl
A
* Helper function for InternetCrackUrl
W
*
*/
void
ConvertUrlComponentValue
(
LPSTR
*
lppszComponent
,
LPDWORD
dwComponentLen
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment