GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * shoes/http/winhttp.c: the options weren't taking effect on the session, 
 apply them to the request.
why (author)
Sat Oct 04 15:41:45 -0700 2008
commit  376dd5ccf8c1672a7a1aeb40d83a6397a82e3a1c
tree    044d518ae36775aa835e3a23f19eb7c7a4f6aab6
parent  dfeea79722918eee8b3282570945be46e1461be0
...
73
74
75
 
 
 
 
 
 
 
 
 
76
77
78
...
80
81
82
83
 
84
85
86
87
88
89
 
90
91
92
93
94
95
96
97
98
99
100
101
102
103
...
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
...
89
90
91
 
92
93
94
95
96
97
 
98
99
100
 
 
 
 
 
 
 
 
 
101
102
103
0
@@ -73,6 +73,15 @@ shoes_winhttp(LPCWSTR host, INTERNET_PORT port, LPCWSTR path, TCHAR **mem, ULONG
0
   if (sess == NULL)
0
     goto done;
0
 
0
+ conn = WinHttpConnect(sess, host, port, 0);
0
+ if (conn == NULL)
0
+ goto done;
0
+
0
+ req = WinHttpOpenRequest(conn, L"GET", path,
0
+ NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0);
0
+ if (req == NULL)
0
+ goto done;
0
+
0
   proxy = _wgetenv(L"http_proxy");
0
   if (proxy != NULL)
0
   {
0
@@ -80,24 +89,15 @@ shoes_winhttp(LPCWSTR host, INTERNET_PORT port, LPCWSTR path, TCHAR **mem, ULONG
0
     proxy_info.dwAccessType = WINHTTP_ACCESS_TYPE_NAMED_PROXY;
0
     proxy_info.lpszProxy = proxy;
0
     proxy_info.lpszProxyBypass = NULL;
0
- WinHttpSetOption(sess, WINHTTP_OPTION_PROXY, &proxy_info, sizeof(proxy_info));
0
+ WinHttpSetOption(req, WINHTTP_OPTION_PROXY, &proxy_info, sizeof(proxy_info));
0
   }
0
 
0
   if (!(flags & SHOES_DL_REDIRECTS))
0
   {
0
     DWORD options = WINHTTP_DISABLE_REDIRECTS;
0
- WinHttpSetOption(sess, WINHTTP_OPTION_DISABLE_FEATURE, &options, sizeof(options));
0
+ WinHttpSetOption(req, WINHTTP_OPTION_DISABLE_FEATURE, &options, sizeof(options));
0
   }
0
 
0
- conn = WinHttpConnect(sess, host, port, 0);
0
- if (conn == NULL)
0
- goto done;
0
-
0
- req = WinHttpOpenRequest(conn, L"GET", path,
0
- NULL, WINHTTP_NO_REFERER, WINHTTP_DEFAULT_ACCEPT_TYPES, 0);
0
- if (req == NULL)
0
- goto done;
0
-
0
   if (!WinHttpSendRequest(req, WINHTTP_NO_ADDITIONAL_HEADERS, 0,
0
     NULL, 0, 0, 0))
0
     goto done;

Comments

    No one has commented yet.