[squid-users] 411 error

From: Robert Davis <bob@dont-contact.us>
Date: Sun, 05 May 2002 18:19:37 -0400

Hi

I am new to squid. I installed squid because I needed to test a program I wrote with a firewall. I
looked and found squid to be the only firewall installed by default on linux. I have a vc++ app
written with httpopenrequest and httpsendrequest. I was getting a 411 error when I did a "HEAD"
request and a 200 when a "GET" request was done. The error read length required but none of the
functions had length as an argument. I found that version 2.2 of squid was giving me this error
where as version 2.4 of squid did not. My questions is 2 fold.

1. How can I see the headers of the request so I can see what the problem with the app is? I have
read in the archives that a protocol analyzer may be the only way.
2. Is this typical behaviour of proxies? I need this app to work with all proxies.
3. How can I fix my app so it works more proxies?

Here is the basic vc++ code.

    HINTERNET hInet = InternetOpen("proxy test", INTERNET_OPEN_TYPE_PRECONFIG, NULL,NULL,NULL);
    HINTERNET hConnect = InternetConnect(hInet,
                                         "www.yahoo.com",
                                         INTERNET_INVALID_PORT_NUMBER,
                                         "",
                                         "",
                                         INTERNET_SERVICE_HTTP,
                                         0, 0);
    if (hConnect == NULL) {
        return;
    }

    HINTERNET hHttpFile = HttpOpenRequest(hConnect,
                                          "HEAD",
                                          "/index.html",
                                          NULL,
                                          NULL,
                                          0,
                                          0,
                                          0);
    if (hHttpFile == NULL) {
        return;
    }

    string sBuff;
    string sData;

    nRet=HttpSendRequest(hHttpFile, NULL, 0, 0, 0);
    if (nRet) {
        index=0;
        bufsize=4;
        nRet=HttpQueryInfo(hHttpFile, HTTP_QUERY_STATUS_CODE|HTTP_QUERY_FLAG_NUMBER,
(void*)&StatusCode, &bufsize, &index);

Thanks
bob

-- 
Robert Davis
email: mailto:rdavis@lillysoftware.com
        mailto:bob@bobsbits.net
web:   http://www.bobsbits.net
phone: work: 603-926-9696 x3456
        home: 603-778-0781
n42 58.476 w70 55.454
Received on Sun May 05 2002 - 16:20:07 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 17:07:55 MST