Keep-alive mandatory on response?

122 views
Skip to first unread message

Claudio Villalobos

unread,
Jul 26, 2013, 5:48:52 PM7/26/13
to golia...@googlegroups.com
Hello,

I am trying to replace a currently existing API running on rails (slow!) with something running on Goliath.

The api returns text responses but for some reason the client is unable to process correctly a response from Goliath. I compared the content of the responses from 
both servers and it is the same (hex based comparison)


So I guess it must be something on the headers?

The only difference I see here is that when the client makes a request it includes the Connection: Keep-alive header and Rails responds with this header as well while Goliath does not.

So my question is: if a client sends a request with Connection: Keep-alive, is the server obliged to reply with the same header?

Sadly, I don't have access to the client source, so I am not sure what else to try. 
The errors are of little use. I notice there is an error because the subsequent requests
are GETs of each of the indexes in that array indexes=[2697;13533;13534;] and 

when using Goliath it does them like this:
GET [2697
GET 13533
GET 13534
GET ]

and when using Rails like this:
GET 2697
GET 13533
GET 13534

I understand thats difficult to debug with minimal information and without the client but I am totally lost- any pointers are appreciated! thanks.
-- 

Goliath:
GET /m/addressBook?api=contactGetIndexes&userLogin=5555752001&seqn=1354551 HTTP/1.1
Connection: Keep-Alive
User-Agent: Jakarta Commons-HttpClient/3.1

HTTP/1.1 200 OK
Content-Type: text/plain; charset=iso-8859-1
Content-Length: 34
Server: Goliath
Date: Fri, 26 Jul 2013 15:51:08 GMT

res=OK
indexes=[2697;13533;13534;] 

Rails:
GET /m/addressBook?api=contactGetIndexes&userLogin= 5555752001&seqn=1960916 HTTP/1.1
Connection: Keep-Alive
User-Agent: Jakarta Commons-HttpClient/3.1

HTTP/1.1 200 OK
Server: nginx/1.0.15
Date: Fri, 26 Jul 2013 19:48:40 GMT
Content-Type: text/plain; charset=iso-8859-1
Connection: keep-alive
ETag: "5fa9aba8f3ede08fe357c76787346539"
X-Runtime: 10
Content-Length: 34
Cache-Control: private, max-age=0, must-revalidate

res=OK
indexes=[2697;13533;13534;] 

Ilya Grigorik

unread,
Jul 29, 2013, 10:31:57 PM7/29/13
to golia...@googlegroups.com
Hi Claudio. This seems like some peculiar quirk in your client code... An HTTP 1.1 server uses keep-alive by default, so the extra keep-alive header should not make any different to the client (unless the jakarta client is explicitly looking for it, but even then, the request should still succeed). 

=/



--
You received this message because you are subscribed to the Google Groups "Goliath.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to goliath-io+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Claudio Villalobos

unread,
Jul 29, 2013, 11:43:05 PM7/29/13
to golia...@googlegroups.com
Hi,

Right, that's what I thought :/ 

How could I go about sending the Connection: Keep-alive on the response anyway to prove that it is the reason of it failing?

Thanks


--
You received this message because you are subscribed to a topic in the Google Groups "Goliath.io" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/goliath-io/1vFtBLVUng4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to goliath-io+...@googlegroups.com.

Ilya Grigorik

unread,
Jul 30, 2013, 1:31:49 AM7/30/13
to golia...@googlegroups.com
When returning the response, you can specify custom headers.. E.g.

[200, {'X-header' => 'value'}, response]

Claudio Villalobos

unread,
Jul 30, 2013, 11:04:38 AM7/30/13
to golia...@googlegroups.com

I mimicked all of Rails headers and the client still has problems parsing the response from goliath :/ 
I am out of ideas. Same header, same response... 

Thanks for your help anyway 
Reply all
Reply to author
Forward
0 new messages