[ grinder-Bugs-3484390 ] FireFox 10/https:NPE in ConnectionHandlerImplementation

SourceForge.net <[email protected]> Sun, 12 Feb 2012 07:05:33 -0800
Newsgroups gmane.comp.java.grinder.devel
Message-ID <[email protected]>
Bugs item #3484390, was opened at 2012-02-04 08:58
Message generated for change (Comment added) made by philipa
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3484390&group_id=18598

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: TCPProxy
Group: None
>Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Philip Aston (philipa)
Assigned to: Philip Aston (philipa)
>Summary: FireFox 10/https:NPE in ConnectionHandlerImplementation

Initial Comment:
Two users (Ouray Viney and Zack) independently report the following stack when recording over HTTPS:

1/17/12 9:08:43 AM (tcpproxy): Failed to determine proxy destination.
Client opened connection but sent no bytes.
1/17/12 9:08:43 AM (tcpproxy): UNEXPECTED - No current request
Exception in thread "Filter thread for site.test.com:443->127.0.0.1:2391" java.lang.NullPointerException
        at net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation$Request.expectingResponseBody(ConnectionHandlerImplementation.java:400)
        at net.grinder.plugin.http.tcpproxyfilter.ConnectionHandlerImplementation.handleResponse(ConnectionHandlerImplementation.java:277)
        at net.grinder.plugin.http.tcpproxyfilter.ConnectionCache.response(ConnectionCache.java:111)
        at net.grinder.plugin.http.tcpproxyfilter.HTTPResponseFilter.handle(HTTPResponseFilter.java:71)
        at net.grinder.tools.tcpproxy.CompositeFilter.handle(CompositeFilter.java:58)
        at net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$OutputStreamFilterTee.handle(AbstractTCPProxyEngine.java:548)
        at net.grinder.tools.tcpproxy.AbstractTCPProxyEngine$FilteredStreamThread.interruptibleRun(AbstractTCPProxyEngine.java:417)
        at net.grinder.util.thread.InterruptibleRunnableAdapter.run(InterruptibleRunnableAdapter.java:59)
        at java.lang.Thread.run(Unknown Source)

I initially though this could be a connection time out. Zack says "Setting the connection timeout to higher values did not help. Actually the exception occurs immediately after requesting the HTTPS url in the browser, so I'm not sure the timeout setting is involved."

----------------------------------------------------------------------

>Comment By: Philip Aston (philipa)
Date: 2012-02-12 07:05

Message:
Following further testing by Ouray, we've been able to track this down to
the use of FireFox 10 and https.

A plain recording of HTTPS interaction from FF10 shows:

--- www.google.co.uk:443->localhost.localdomain:39112 opened --
--- localhost.localdomain:39112->www.google.co.uk:443 opened --
------ www.google.co.uk:443->localhost.localdomain:39112 ------
G
------ www.google.co.uk:443->localhost.localdomain:39112 ------
ET / HTTP/1.1
Host: www.google.co.uk
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:10.0) Gecko/20100101
Firefox/10.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-gb,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Cookie:
GPC=FW=0:GHV=2:MGLS=0:MGV=0:SG=0:TE=0:TS=0:TV=0:WCYD=0:SIG=knL9H0E5R8onR5e1;
PREF=ID=c282e4e8016945fa:U=6dfcefcd49878ae8:FF=4:LD=en:TM=1169896114:LM=1327831028:FV=2:S=KyOo4WI4OXFgcqzk;
NID=56=pQ3hqAJqUWwVUtmIgniAOMZYb5d8KgY3TVqdGSm1RcQI6yn_HBl5IaZ_tNHGSguQaJhaE80B342p-f5GB5z7-2mRg08h3Wsmh48Rns33_-AF1eHktzf44dF80S4PD41E;
XmarksFirstTime=0;
SID=DQAAAGMBAADIsX9JAxRwaGs8-oFn05wRY95x7RJ-1SlUA2V0YXoo2GZsvaf63XgbbYuyjk22TRcr09XYor5Phcg-hP0lzGGQeBHpsdjCJBKLBaSBmUnLoeVvy71rtVPSXUjT2W5q76KZOk1VutIQWSMVWnco66KN2huQ3Ak7l9v_7-5Jlu4aoUEzpC29oqWJxVDrgwyXRyTTTpv8FsrYiAPoPsrEqN5YhNVL2cg-D__spJHYliFmoFii_9A8F_6jbFX19uA353cdrtAbq53HAUufUNbZeuc9C4NQV8pIi0SWprae7wPH7C1gHn1_F9mNEHqgvbuRHcQHheIY7c3yL93mkgfMikxETt1NmZllNbLfrUonjN0ZzGzJAiHHAzcMR-Q9nPeX1jJ9qFeXvmvwX9utSy1vwdupBgpkKmn4A65113Itp0TAbyAuHpHqFfrLQMlwW892MzOEXAEccstHzUHiR0FCV_8MwEvVbMvWxVfNK7QzaH-HGQ;
HSID=AKo_uCle5aecl1lgp;
MPRF=H4sIAAAAAAAAAKvombzi_RfVLiaGSUwKqakpRilJBgaGJhYpiUYpBoapZpYGZkkWyUlG5iZJyRYTmBkAM3V0PzAAAAA;
SSID=AuiTZYxauUd2Ma_Mh
Cache-Control: max-age=0
----------------------------------------

Note the initial fragment containing just a "G". The Grinder doesn't handle
this. Note this comment I made once upon a time:

  //...
  protected final class FilteredStreamThread implements
InterruptibleRunnable {

    // For simplicity, the filters take a buffer oriented approach.
    // This means that they all break at buffer boundaries. Our buffer
    // is huge, so we shouldn't practically cause a problem, but the
    // network clearly can by giving us message fragments. I consider
    // this a bug, we really ought to take a stream oriented approach.
    private static final int BUFFER_SIZE = 65536;


Looks like I'll have to fix the handlers to use a stream oriented contract.

----------------------------------------------------------------------

Comment By: Philip Aston (philipa)
Date: 2012-02-04 09:13

Message:
Waiting for Ouray or Zack to try the patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=118598&aid=3484390&group_id=18598

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/