PHP Classes

Some requests don't get to the server

Recommend this page to a friend!

      Simple Authentication and Security Layer  >  All threads  >  Some requests don't get to the server  >  (Un) Subscribe thread alerts  
Subject:Some requests don't get to the server
Summary:Requests are drop in the authentication process.
Messages:4
Author:Louis-Charles
Date:2009-03-26 16:04:43
Update:2009-03-30 12:25:04
 

  1. Some requests don't get to the server   Reply   Report abuse  
Picture of Louis-Charles Louis-Charles - 2009-03-26 16:04:43
When I send requests with Digest Authentication, some requests are not received by the server.

Normal process of a request is
part 1. 401 (authentication required)
part 2. 201 (item created)

When I send 100 requests only 97% (avg) of the request have this behavior.

For the others 3% requests, only part 1 is received by the server.
$this->http->ReadReplyHeaders($headers) return ""
and $this->http->response_status is ""

My current work around is to send the request in a loop that end when the status is set to something (with a max try option).

Is this a normal behavior of the http protocol? Or is there something to fix?

  2. Re: Some requests don't get to the server   Reply   Report abuse  
Picture of Louis-Charles Louis-Charles - 2009-03-26 16:05:55 - In reply to message 1 from Louis-Charles
Another detail. If I remove the authentication process, all requests are received by the server.

  3. Re: Some requests don't get to the server   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-03-26 17:14:05 - In reply to message 1 from Louis-Charles
I am not sure what you mean, but the HTTP class is ready to handle multi-step authentication types that have more than one step that depends on the response of the previous. All this is encapsulated in a single ReadReplyHeaders call. If you enable debug output you may see several requests being sent.

  4. Re: Some requests don't get to the server   Reply   Report abuse  
Picture of Louis-Charles Louis-Charles - 2009-03-30 12:25:04 - In reply to message 3 from Manuel Lemos
I have a REST web service with digest authentication.
When I send 100 POST requests, the server don't create 100 items (it create 94-97 items).

After verification, I found out that the server received all initial requests, but reply with a 401 code to request digest authentication (normal up to here). For the majority of the request, a 201 status code (that means item created) is logged. However, for 3-6 items, this status is not logged and the item is not created.

On the client, using the http class, I identified a difference between a request that works and one that doesn't. This difference is in the $http->response_status variable. If the request "work", the variable have something else it's empty. I check this variable after the ReadReplyHeaders call and the function doesn't return any error.

To work around this issue, I have a loop that resend the request until the $http->response_status variable is set. I just feel that this loop should be inside the http class.

Thank you for taking time to look at my request.