'MSDN'에 해당되는 글 3건

  1. 2009.09.09 Something worth knowing about HttpEndRequest by Dansoonie
  2. 2009.06.16 MSDN을 보고 있자니... 2 by Dansoonie
  3. 2009.04.24 내가 MS를 싫어하는 이유... 2 by Dansoonie
It's not something MAJORLY important, but I thought it is worth knowing it.

I just found out that by the time when HttpEndRequest completes, the header of the response is already available. Which means, you are able to call HttpQueryInfo on the resource handle(handle obtained from HttpOpenRequest()) for further actions.

Was this something obvious?
Because, the MSDN description of HttpEndRequest is nothing more than this
Ends an HTTP request that was initiated by HttpSendRequestEx.

I didn't know this until now. I came to learn about this fact by reading and article on how to "How to use HttpSendRequestEx with password-protected URLs." The following is an excerpt from the article where I have been able to realize the fact.
Unlike HttpSendRequest, HttpSendRequestEx will not resubmit a request on its own after receiving the "401 Access Denied" status code from the server. Therefore, HttpEndRequest will fail with an ERROR_INTERNET_FORCE_RETRY error.

Great !!! I have learned something. However, I don't think that HttpEndRequest fails with ERROR_INTERNET_FORCE_RETRY error upon receiving "401 Access Denied" status code when network is supposed to behave asynchronously.

Ah... the frustration...
Microsoft should put more effort in making their document more complete if their API's lack consistency. Right??? I'm I missing something???
Posted by Dansoonie
짜증이 나는군하 !!!

WinINet API중에 InternetOpenURL과 HttpSendRequest의 차이를 설명해 주는 문장이 WinINet으로 Authentication 처리 어떻게 해주는가에 대한 문서에 다음과 같이 달랑 두 문장으로 나온다.
The InternetOpenURL and HttpSendRequest functions complete successfully even when authentication is required. The difference is, the data returned in the header files and InternetReadFile would receive an HTML page informing the user of the status code.

그래서... 둘이 어떻게 다르다는 건지 모르겠다...
Orz

도움좀...
Posted by Dansoonie
MSDN을 보다보면 짜증이 난다...

따지고 보면 .Net Framework에 대한 document는 잘 되어있어서 MSDN 자체를 일방적으로 싫어한다고 말할 수는 없지만, Windows에서 제공하는 여러 API에 대한 문서는 정말 봐주기 싫을때가 많다. 방금 WinINet에 대해 알아보느라 이것저것 찾아보고 있었는데, WinINet에서 Cookie가 어떤 식으로 관리되고 개발자 입장에서 사용할 수 있는지 보다가 이런 코드가 예제로 나와서 보게 되었다.

char szURL[256];         // buffer to hold the URL
LPSTR lpszData = NULL;   // buffer to hold the cookie data
DWORD dwSize=0;          // variable to get the buffer size needed

// Insert code to retrieve the URL.

retry: 바로 여기

// The first call to InternetGetCookie will get the required
// buffer size needed to download the cookie data.
if (!InternetGetCookie(szURL, NULL, lpszData, &dwSize))
{
    // Check for an insufficient buffer error.
    if (GetLastError()== ERROR_INSUFFICIENT_BUFFER)
    {
        // Allocate the necessary buffer.
        lpszData = new char[dwSize];

        // Try the call again.
        goto retry; 바로 여기
    }
    else
    {
        // Insert error handling code.
    }
   
}
else
{
    // Insert code to display the cookie data.

    // Release the memory allocated for the buffer.
    delete[]lpszData;
}
Code Snippet 출처: http://msdn.microsoft.com/en-us/library/aa385326(VS.85).aspx

음...
goto 문이 사용되었다
ㅡ.ㅡ;

너무 성의 없어 보이지 않나???      

Microsoft에서 .Net Framework을 내놓았을때나, Photosynth와 같이 창의적인 연구를 하는 것을 볼때면 좋아지기도 하는데, 이럴때 다시 싫어진다...

정떨어져 !!!
     

'My Life > 일상' 카테고리의 다른 글

세상은 공평한가보다...  (6) 2009.05.12
살아있는 내 양말의 미스터리...  (0) 2009.05.09
어버이날....  (6) 2009.05.08
ThinkPad 인가 TankPad 인가?  (2) 2009.05.05
언제나 우리의 가슴을 훈훈하게 해주는 짝퉁 !!!  (5) 2009.05.02
씁쓸하다...  (16) 2009.04.16
피봇 모니터가 좋을때...  (4) 2009.04.15
Mafia Wars...  (2) 2009.04.12
옆방 이모가 밉다...  (6) 2009.04.11
친구 결혼식 다녀오다...  (4) 2009.04.11
Posted by Dansoonie