Topic
  • 6 replies
  • Latest Post - ‏2010-08-05T21:21:37Z by Yogesh Raut
Yogesh Raut
Yogesh Raut
27 Posts

Pinned topic No end of message signal to client in case of 204 response

‏2010-08-04T21:19:47Z |
Hi,

I am facing problem with Datapoweer when the http response code is 204 (no content) which indicates that there will be no response.

Some Background:

Datapower sets the Transfer Encoding as chunked which means response data will be sent in chunks to the client. When it comes to 204 response code, there is no response body. It seems like when there is no response body, Datapower doesn't indicate the end of message to client.

So, when client gets the response code as 204, Datapower really doesn't indicate end of response. This causes Client to wait till the time socket timeout occurs.

Questions:

1. Does Datapower 3.8.0.2 supports HTTP 1.1 fully?
2. Why Datapower doesn't send end of message signal to client in case of 204 response where there is no response body?
3. Is there any resolution / workaround to send end of message signal when response code is 204 and transfer encoding is chunked?

Thanks,
Yogesh
Updated on 2010-08-05T21:21:37Z at 2010-08-05T21:21:37Z by Yogesh Raut
  • HermannSW
    HermannSW
    4654 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T11:22:18Z  
    Yogesh,

    how do you get the 204?
    How to recreate that?
    If you could take a packet capture and provide the returned 204 header that would enable recreation/analysis.
    I googled and found this on HTTP 204 response:
    http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-204

    Taking this header as sample response of a "nc -l" HTTP server emulation ...
    $ cat 204
    HTTP/1.1 204 No Content
    Content-Type: text/plain; charset=UTF-8
     
    $ nc -l 127.0.0.1 8888 <204
    GET / HTTP/1.1
    User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    Host: 127.0.0.1:8888
    Accept: */* $
    


    ... seems to work:
    $ curl -v http://127.0.0.1:8888
    * About to connect() to 127.0.0.1 port 8888
    *   Trying 127.0.0.1... connected
    * Connected to 127.0.0.1 (127.0.0.1) port 8888
    > GET / HTTP/1.1
    > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5
    > Host: 127.0.0.1:8888
    > Accept: */* > < HTTP/1.1 204 No Content < Content-Type: text/plain; charset=UTF-8 * Connection #0 to host 127.0.0.1 left intact * Closing connection #0 $
    
    Updated on 2014-03-25T03:41:48Z at 2014-03-25T03:41:48Z by iron-man
  • Yogesh Raut
    Yogesh Raut
    27 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T17:29:22Z  
    • HermannSW
    • ‏2010-08-05T11:22:18Z
    Yogesh,

    how do you get the 204?
    How to recreate that?
    If you could take a packet capture and provide the returned 204 header that would enable recreation/analysis.
    I googled and found this on HTTP 204 response:
    http://www.askapache.com/htaccess/apache-status-code-headers-errordocument.html#status-204

    Taking this header as sample response of a "nc -l" HTTP server emulation ...
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">$ cat 204 HTTP/1.1 204 No Content Content-Type: text/plain; charset=UTF-8 $ nc -l 127.0.0.1 8888 <204 GET / HTTP/1.1 User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 Host: 127.0.0.1:8888 Accept: */* $ </pre>

    ... seems to work:
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">$ curl -v http://127.0.0.1:8888 * About to connect() to 127.0.0.1 port 8888 * Trying 127.0.0.1... connected * Connected to 127.0.0.1 (127.0.0.1) port 8888 > GET / HTTP/1.1 > User-Agent: curl/7.15.5 (i386-redhat-linux-gnu) libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 > Host: 127.0.0.1:8888 > Accept: */* > < HTTP/1.1 204 No Content < Content-Type: text/plain; charset=UTF-8 * Connection #0 to host 127.0.0.1 left intact * Closing connection #0 $ </pre>
    Hermann,

    In my case, I get header "HTTP/1.1 204 Processed" instead of "HTTP/1.1 204 No Content". Header x-dp-response-phrase contains the correct http code "204 No Content". "transfer closed with outstanding read data remaining" indicates to client that there is data remaining when there is not.

    I am not sure where the response code is getting replaced as "204 Processed" instead of "204 No Content".

    1. How do I force Datapower to return "204 No Content" instead of "204 Processed"?
    2. I tried to see in the probe where the response code gets set. In the context tab, I could find "x-dp-response-phrase: 204 No Content". However, it doesn't show the Http Status code. In Probe, where can I find the HTTP status code.
    < HTTP/1.1 204 Processed
    < X-Backside-Transport: OK OK
    < Connection: Keep-Alive
    < Transfer-Encoding: chunked
    < Server: Apache-Coyote/1.1
    < Date: Wed, 04 Aug 2010 19:29:25 GMT
    < X-Client-IP: <<local-ip>>
    < x-dp-response-phrase: 204 No Content
    < Content-Type: text/xml
    < 
    * transfer closed with outstanding read data remaining
    * Closing connection #0
    curl: (18) transfer closed with outstanding read data remaining
    


    Thanks,
    Yogesh
    Updated on 2014-03-25T03:41:39Z at 2014-03-25T03:41:39Z by iron-man
  • HermannSW
    HermannSW
    4654 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T18:27:15Z  
    Hermann,

    In my case, I get header "HTTP/1.1 204 Processed" instead of "HTTP/1.1 204 No Content". Header x-dp-response-phrase contains the correct http code "204 No Content". "transfer closed with outstanding read data remaining" indicates to client that there is data remaining when there is not.

    I am not sure where the response code is getting replaced as "204 Processed" instead of "204 No Content".

    1. How do I force Datapower to return "204 No Content" instead of "204 Processed"?
    2. I tried to see in the probe where the response code gets set. In the context tab, I could find "x-dp-response-phrase: 204 No Content". However, it doesn't show the Http Status code. In Probe, where can I find the HTTP status code.
    <pre class="java dw" data-editor-lang="java" data-pbcklang="java" dir="ltr">< HTTP/1.1 204 Processed < X-Backside-Transport: OK OK < Connection: Keep-Alive < Transfer-Encoding: chunked < Server: Apache-Coyote/1.1 < Date: Wed, 04 Aug 2010 19:29:25 GMT < X-Client-IP: <<local-ip>> < x-dp-response-phrase: 204 No Content < Content-Type: text/xml < * transfer closed with outstanding read data remaining * Closing connection #0 curl: (18) transfer closed with outstanding read data remaining </pre>

    Thanks,
    Yogesh
    Yogesh,

    there is only one hit for "Processed" in the whole HTTP/1.1 spec:
    http://www.ietf.org/rfc/rfc2616.txt

    "204 No Content" is handled in section 10.2.5.
    What you need to do is to take a packet capture on the interface the backend is connected to.
    Then load the .pcap file into a tool like WireShark, choose HTTP under "decode as" and do "Follow TCP Stream" on any packet of the transaction.
    This way you can see whether the 0-size end indication packet is sent from the backend to DataPower, or not.

    If it is not sent by the backend then it is not a DataPower problem.

    If it is send then take a packet capture on the front interface.
    Analyzing with Wireshark as above can prove or disprove whether DataPower sends the 0-size end packet.

    If it does, againg no DataPower problem (client problem).

    It it does not, then you should open a PMR with your configuration and the packet captures taken.
    Hermann.
  • Yogesh Raut
    Yogesh Raut
    27 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T18:40:19Z  
    • HermannSW
    • ‏2010-08-05T18:27:15Z
    Yogesh,

    there is only one hit for "Processed" in the whole HTTP/1.1 spec:
    http://www.ietf.org/rfc/rfc2616.txt

    "204 No Content" is handled in section 10.2.5.
    What you need to do is to take a packet capture on the interface the backend is connected to.
    Then load the .pcap file into a tool like WireShark, choose HTTP under "decode as" and do "Follow TCP Stream" on any packet of the transaction.
    This way you can see whether the 0-size end indication packet is sent from the backend to DataPower, or not.

    If it is not sent by the backend then it is not a DataPower problem.

    If it is send then take a packet capture on the front interface.
    Analyzing with Wireshark as above can prove or disprove whether DataPower sends the 0-size end packet.

    If it does, againg no DataPower problem (client problem).

    It it does not, then you should open a PMR with your configuration and the packet captures taken.
    Hermann.
    Thanks Hermann for the directions. I'll check this in next week and will let you know the resutls.

    Thanks,
    Yogesh
  • Yogesh Raut
    Yogesh Raut
    27 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T21:16:12Z  
    • HermannSW
    • ‏2010-08-05T18:27:15Z
    Yogesh,

    there is only one hit for "Processed" in the whole HTTP/1.1 spec:
    http://www.ietf.org/rfc/rfc2616.txt

    "204 No Content" is handled in section 10.2.5.
    What you need to do is to take a packet capture on the interface the backend is connected to.
    Then load the .pcap file into a tool like WireShark, choose HTTP under "decode as" and do "Follow TCP Stream" on any packet of the transaction.
    This way you can see whether the 0-size end indication packet is sent from the backend to DataPower, or not.

    If it is not sent by the backend then it is not a DataPower problem.

    If it is send then take a packet capture on the front interface.
    Analyzing with Wireshark as above can prove or disprove whether DataPower sends the 0-size end packet.

    If it does, againg no DataPower problem (client problem).

    It it does not, then you should open a PMR with your configuration and the packet captures taken.
    Hermann.
    Retrieving the response code from header 'x-dp-response-code' and setting it to 'x-dp-response-phrase' resolved the problem.

    Thanks Hermann for giving me feeling that Datapower process 204 response correctly. Your analysis helped to look into deeper for the root cause.

    Thanks,
    Yogesh
  • Yogesh Raut
    Yogesh Raut
    27 Posts

    Re: No end of message signal to client in case of 204 response

    ‏2010-08-05T21:21:37Z  
    Retrieving the response code from header 'x-dp-response-code' and setting it to 'x-dp-response-phrase' resolved the problem.

    Thanks Hermann for giving me feeling that Datapower process 204 response correctly. Your analysis helped to look into deeper for the root cause.

    Thanks,
    Yogesh
    Just a correction:

    Retrieving the response code from header 'x-dp-response-code' and setting it to 'x-dp-response-phrase' when 'x-dp-response-code' doesn't contain 204 resolved the problem.

    Thanks,
    Yogesh