cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re "On connected" callback function

From: Michael Wood <esiotrot_at_gmail.com>
Date: Mon, 30 Mar 2009 11:01:32 +0200

On Mon, Mar 30, 2009 at 9:58 AM, thhk nhkr <thhknhkr_at_yahoo.com> wrote:
[...]
> Thanks for the answer!
>
> Not really a protocol, I'll explain, some of the HTTP servers we are
> connecting to, demands clients to "Login" after connecting.
>
> By "Login" I mean that the server is waiting to certain message that will be
> sent by the client (typically it will contain user name and password).
>
> Just after this Login request was successfully ended the server will allow
> the client to send other requests to him.

This is a protocol, so it would probably help if you gave examples of
the requests from the client and the responses that the server sends
back as a result. i.e. the HTTP headers and any other relevant info.
This way we would not have to guess what you are talking about :)

> So I need to know when a connection takes palce, in order to send this Login
> request.

Does this work with a normal web browser?

Are you sure it's not just the normal HTTP 401 Authorization Required mechanism?

How this sort of thing normally works with a normal browser is that
the browser makes one request without authentication, the server sends
back a 401 response, and based on that the browser sends a second
request with the authentication details. The server then responds
with the results the client requested.

If the browser knows up front that it must authenticate it can just
send the request with authentication details without first sending it
without and waiting for the 401 response from the server.

-- 
Michael Wood <esiotrot_at_gmail.com>
Received on 2009-03-30