external/web-page-replay.git
13 days agoAdd x-chrome-variations to the list of "undesirable headers" master
tonyg@google.com [Wed, 8 May 2013 15:41:15 +0000 (15:41 +0000)]
Add x-chrome-variations to the list of "undesirable headers"

Contributed by: Ryan McLoughlin (rmcloughlin@google.com)

Review URL: https://codereview.chromium.org/14667010

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@512 164481a5-15cb-f69f-4b93-856c5b7754c5

5 weeks agoFix race in persisting httparchive after recording.
tonyg@google.com [Tue, 16 Apr 2013 16:41:42 +0000 (16:41 +0000)]
Fix race in persisting httparchive after recording.

When the http server shuts down, its daemon threads may still be living and
there is a chance that they could still write to the httparchive dict. When this
happens during pickling, it raises:
RuntimeError: dictionary changed size during iteration

This change prevents other threads from interrupting and updating the dict
during iteration.

Review URL: https://codereview.chromium.org/13991011

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@511 164481a5-15cb-f69f-4b93-856c5b7754c5

2 months agoBug fix: set trueport to None if host header doesn't contain a port number.
tonyg@google.com [Wed, 13 Mar 2013 17:22:08 +0000 (17:22 +0000)]
Bug fix: set trueport to None if host header doesn't contain a port number.

Contributed by: Ryan McLoughlin (rmcloughlin@google.com)

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@510 164481a5-15cb-f69f-4b93-856c5b7754c5

2 months agoAccept host headers in the form hostname:port
tonyg@google.com [Fri, 22 Feb 2013 22:44:34 +0000 (22:44 +0000)]
Accept host headers in the form hostname:port

Contributed by: Ryan McLoughlin (rmcloughlin@google.com)

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@509 164481a5-15cb-f69f-4b93-856c5b7754c5

2 months agoStart http & https proxies on 0.0.0.0 when in server mode.
tonyg@google.com [Thu, 21 Feb 2013 19:14:19 +0000 (19:14 +0000)]
Start http & https proxies on 0.0.0.0 when in server mode.

Contributed by: Ryan McLoughlin (mcloughlin@google.com)

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@508 164481a5-15cb-f69f-4b93-856c5b7754c5

5 months agoAdd a deterministic getTimezoneOffset() method.
tonyg@google.com [Wed, 19 Dec 2012 21:20:42 +0000 (21:20 +0000)]
Add a deterministic getTimezoneOffset() method.

The real getTimezoneOffset() depends on the timezone of the machine. GMail
doesn't replay properly unless the timezone is the same as it was during the
recording. A deterministic implementation is necessary to replay on bots with
a timezone different than where the original recording was made.

This implementation fakes PST/PDT for the year 2010. That makes Closure's
TimeZoneDetector happy. For other years, the method is still deterministic, but
we don't bother to simulate DST there (as that would require hardcoding a
bunch of dates).
Review URL: https://codereview.chromium.org/11612029

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@506 164481a5-15cb-f69f-4b93-856c5b7754c5

6 months agoFixes a problem that keeps the /web-page-replay-command-status command from working...
tonyg@google.com [Tue, 20 Nov 2012 16:44:52 +0000 (16:44 +0000)]
Fixes a problem that keeps the /web-page-replay-command-status command from working properly if the archive file is empty.

Patch contributed by: rmcloughlin@google.com

Issue=http://code.google.com/p/web-page-replay/issues/detail?id=28

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@505 164481a5-15cb-f69f-4b93-856c5b7754c5

6 months agoAugment command 'status' custom handler with CLI options and archive stats.
tonyg@google.com [Fri, 2 Nov 2012 23:17:04 +0000 (23:17 +0000)]
Augment command 'status' custom handler with CLI options and archive stats.

Patch contributed by: zeinwali@gmail.com

BUG=
Review URL: http://codereview.chromium.org/11292002

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@502 164481a5-15cb-f69f-4b93-856c5b7754c5

6 months agoFix replaying on Windows.
tonyg@google.com [Tue, 23 Oct 2012 21:50:18 +0000 (21:50 +0000)]
Fix replaying on Windows.

1. Instead of running openssl at runtime to generate the cert, just check in a
   generated certfile.
2. Bind to localhost only. This fixes a security dialog prompt.
Review URL: https://codereview.chromium.org/11232070

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@501 164481a5-15cb-f69f-4b93-856c5b7754c5

6 months agoThis partially answers a request in http://codereview.chromium.org/9618036/.
tonyg@google.com [Mon, 22 Oct 2012 21:13:29 +0000 (21:13 +0000)]
This partially answers a request in codereview.chromium.org/9618036/.
The Json response can be further used as a response to 'custom-handlers'.

Patch contributed by: zeinwali@gmail.com

BUG=
Review URL: http://codereview.chromium.org/11190025/

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@500 164481a5-15cb-f69f-4b93-856c5b7754c5

6 months agoInclude 'params' url component in urlparse.
tonyg@google.com [Mon, 22 Oct 2012 19:16:54 +0000 (19:16 +0000)]
Include 'params' url component in urlparse.
Some urls are only differentiated by the 'params' section of the url, while all recorded to same resource in the archive (overwritten).

Some of these urls are encountered on yahoo.com, cnn.com and espn.com
*http://www.yahoo.com/p.gif;_ylp=A2KLf_XtrIRQshgA7SKbvZx4?t=1204251968254&hpset=0
*http://ad.doubleclick.net/adj/espn.us.com.espn/espnfrontpage;pgtyp=espnfrontpage;sp=espn;pos=InContent;u=swid=3AF068CA-4A03-42B2-8867-A4E9E5B830ED%7Cpgtyp=espnfrontpage%7Csp=espn;dcopt=ist;sz=300x600,300x250,1x1;tile=3;ord=4619999999

On Espn.com site, such urls are requested multiple times, but identified as repeated requests and recorded to the same resource. This is also an issue, while recording from different clients that might pass different arguments in the params component.

Patch contributed by: zeinwali@gmail.com

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@499 164481a5-15cb-f69f-4b93-856c5b7754c5

7 months agoMinify the deterministic script to overcome js syntax errors when injected to quoted...
tonyg@google.com [Fri, 19 Oct 2012 15:33:07 +0000 (15:33 +0000)]
Minify the deterministic script to overcome js syntax errors when injected to quoted HTML tags.
The issue is encountered in a resource on msn.com. Namely: (http://rad.msn.com/ADSAdClient31.dll?GetSAd=&DPJS=4&PN=MSFT&ID=38035C8940D1629D10A75F4B43D16259&MUID=38035C8940D1629D10A75F4B43D16259&PG=MSNIF1&AP=1455) the resource is a script which is transferred with the wrong content-type (text/html) and has a string containing "<head>" section that WPR attempts to inject the deterministic.js script to. After the injection the line breaks in deterministic.js cause a syntax error in the resulting js and blocks execution (and potentially more requests).

*This could partially solve the issue: http://code.google.com/p/web-page-replay/issues/detail?id=5
*This also works with the fix in issue: http://codereview.chromium.org/10411060/#ps5001

The msn script in question has content body that contains the following piece of code:
{var s = '<html><head><title>Advertisement</title></head><body id="'
....

Patch contributed by: zeinwali@gmail.com

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@498 164481a5-15cb-f69f-4b93-856c5b7754c5

7 months agoFix Date's prototype in deterministic.js.
tonyg@google.com [Thu, 18 Oct 2012 23:43:31 +0000 (23:43 +0000)]
Fix Date's prototype in deterministic.js.

This makes it so 'new Date() instanceof Date' properly returns true. This was
necessary for replaying Google Calendar.
Review URL: https://codereview.chromium.org/11194072

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@497 164481a5-15cb-f69f-4b93-856c5b7754c5

7 months agoadding a command to merge multiple archives (chaining resource from archives in order)
tonyg@google.com [Fri, 12 Oct 2012 15:04:49 +0000 (15:04 +0000)]
adding a command to merge multiple archives (chaining resource from archives in order)

Contributed by: zeinwali@gmail.com

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@496 164481a5-15cb-f69f-4b93-856c5b7754c5

7 months agoDon't prevent python from exiting when there is HTTP server thread activity.
tonyg@google.com [Thu, 11 Oct 2012 22:41:56 +0000 (22:41 +0000)]
Don't prevent python from exiting when there is HTTP server thread activity.

This is useful so that Chrome's webpagereplay.py wrapper doesn't hit a 5 min
timeout when exiting cleanly.
Review URL: https://codereview.chromium.org/11048035

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@495 164481a5-15cb-f69f-4b93-856c5b7754c5

8 months agoFix sysctl kwarg bug.
slamm@google.com [Wed, 29 Aug 2012 17:37:47 +0000 (17:37 +0000)]
Fix sysctl kwarg bug.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@494 164481a5-15cb-f69f-4b93-856c5b7754c5

8 months agoOnly shape dns port when running dns server.
slamm@google.com [Wed, 29 Aug 2012 17:37:41 +0000 (17:37 +0000)]
Only shape dns port when running dns server.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@493 164481a5-15cb-f69f-4b93-856c5b7754c5

8 months agoAdd sudo for commands that need it.
slamm@google.com [Wed, 22 Aug 2012 20:15:45 +0000 (20:15 +0000)]
Add sudo for commands that need it.
(Can add those commands to sudoers instead of running whole script as root.)

BUG=

Review URL: https://chromiumcodereview.appspot.com/10831417

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@492 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoSupport HTTPS on perftracker.
simonjam@chromium.org [Sat, 11 Aug 2012 00:57:20 +0000 (00:57 +0000)]
Support HTTPS on perftracker.

BUG=none

Review URL: https://chromiumcodereview.appspot.com/10826104

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@491 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoAdd --append option to replay.py.
slamm@google.com [Tue, 7 Aug 2012 17:51:22 +0000 (17:51 +0000)]
Add --append option to replay.py.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10829202

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@490 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoProblems of multiple headers with the same name in an http response.
fdeng@chromium.org [Tue, 24 Jul 2012 20:30:52 +0000 (20:30 +0000)]
Problems of multiple headers with the same name in an http response.

This CL is to make WPR handle multiple headers with the same name and fix send_error in
httpproxy.py.

The http response may contain multiple headers with the same name. For example,
there might be multiple "set-cookie" headers.
The correct format of these headers in the response is as bellow:

    set-cookie: GMAIL_IMP=EXPIRED; Expires=Wed, 11-Jul-2012 21:53:17 GMT;
Path=/mail; Secure
    set-cookie: GMAIL_STAT_3d81=EXPIRED; Expires=Wed, 11-Jul-2012 21:53:17 GMT;
Path=/mail; Secure

where each cookie got set by one "set-cookie" header.

However, it is observed from the client(browser) side that, multile "set-cookie"
headers becomes one line in the response from WPR, which looks like:
    set-cookie: GMAIL_IMP=EXPIRED; Expires=Wed, 11-Jul-2012 21:53:17 GMT;
Path=/mail; Secure, GMAIL_STAT_3d81=EXPIRED; Expires=Wed, 11-Jul-2012 21:53:17
GMT; Path=/mail; Secure

This bad formatting makes the client (browser) not be able to parse the
set-cookie headers properly.

The cause of this problem can be traced from httpclient.RealHttpFetch.__call__,
where it constructs the ArchivedHttpResponse using response.getheaders().

 archived_http_response = httparchive.ArchivedHttpResponse(
            response.version,
            response.status,
            response.reason,
            response.getheaders(),
            chunks,
            delays)

By looking into the value of response.getheaders, I found that the "set-cookie"
headers are formatted wrongly. I think this is a glitch in
httplib.HttpResponse.
(This issue is reported at http://bugs.python.org/issue1660009 and
http://stackoverflow.com/questions/1649401/how-to-handle-multiple-set-cookie-...)

The workaround is not to use response.getheaders() but use response.msg.headers
instead. I modified the code as such and I am able to log into gmail and other
website which requires logging in.

Another modification I made is in httpproxy.HttpArchiveHandler.send_error(self,
status). This function override the one in
BaseHTTPServer.BaseHTTPRequestHandler.
However, the signature of the function is not compatible with the one in its
parent class. This is problematic because other functions in the parent class
still make calls to this fucntion.
For example, BaseHTTPServer.BaseHTTPRequestHandler.parse_request makes call to
it via "self.send_error(400, "Bad request version (%r)" % version)".
So I believe we need to make the function signature look the same as it is in
its parent class.

BUG=None
TEST= httpclient_test.py
Review URL: https://chromiumcodereview.appspot.com/10807016

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@489 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoadd _check_output
simonjam@chromium.org [Mon, 23 Jul 2012 23:02:10 +0000 (23:02 +0000)]
add _check_output

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@488 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agouse subprocess
simonjam@chromium.org [Mon, 23 Jul 2012 23:02:08 +0000 (23:02 +0000)]
use subprocess

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@487 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoadd comment
simonjam@chromium.org [Mon, 23 Jul 2012 23:02:05 +0000 (23:02 +0000)]
add comment

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@486 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agoimplement _get_cwnd
simonjam@chromium.org [Mon, 23 Jul 2012 23:02:03 +0000 (23:02 +0000)]
implement _get_cwnd

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@485 164481a5-15cb-f69f-4b93-856c5b7754c5

9 months agomore fixes
simonjam@chromium.org [Mon, 23 Jul 2012 23:01:58 +0000 (23:01 +0000)]
more fixes

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@484 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoRevive perftracker
simonjam@chromium.org [Fri, 20 Jul 2012 18:26:16 +0000 (18:26 +0000)]
Revive perftracker

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@483 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoFixes after refactor in r479:
sullivan@chromium.org [Mon, 16 Jul 2012 18:48:21 +0000 (18:48 +0000)]
Fixes after refactor in r479:
Fixed log line which became inaccurate in platformsettings.py.
Fixed invalid reference to get_platform_settings in httparchive.py.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@482 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoTemporarily disable server RTT measurement to get recording working reliably.
tonyg@google.com [Thu, 12 Jul 2012 21:11:54 +0000 (21:11 +0000)]
Temporarily disable server RTT measurement to get recording working reliably.
Review URL: https://chromiumcodereview.appspot.com/10701163

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@481 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoAdd proxyshaper rate limiter tests.
slamm@google.com [Fri, 29 Jun 2012 17:09:56 +0000 (17:09 +0000)]
Add proxyshaper rate limiter tests.
Fix test-revealed issues.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10695036

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@480 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoRefactor platformsettings.
slamm@google.com [Thu, 28 Jun 2012 23:29:45 +0000 (23:29 +0000)]
Refactor platformsettings.
 - Automatically create an instance and add functions to module-level.
   (The random module uses this pattern.)
 - Use atexit.register to automate restoring values.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10542042

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@479 164481a5-15cb-f69f-4b93-856c5b7754c5

10 months agoTraffic shaping in Python.
slamm@google.com [Thu, 28 Jun 2012 20:30:13 +0000 (20:30 +0000)]
Traffic shaping in Python.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10380040

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@478 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoCreate 1.1.2 for r476 release.
tonyg@google.com [Thu, 14 Jun 2012 19:44:49 +0000 (19:44 +0000)]
Create 1.1.2 for r476 release.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@477 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoProvide a fallback if pkg_resources module is unavailable.
slamm@google.com [Wed, 13 Jun 2012 16:06:48 +0000 (16:06 +0000)]
Provide a fallback if pkg_resources module is unavailable.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10546134

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@476 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoMove timer function to platformsettings.
slamm@google.com [Tue, 5 Jun 2012 15:31:18 +0000 (15:31 +0000)]
Move timer function to platformsettings.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10483021

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@475 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoFix pkg_resources use.
slamm@google.com [Mon, 4 Jun 2012 23:29:11 +0000 (23:29 +0000)]
Fix pkg_resources use.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@474 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoFix line endings.
slamm@google.com [Mon, 4 Jun 2012 23:26:42 +0000 (23:26 +0000)]
Fix line endings.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@473 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoFor SPDY, use the generated certfile that contains the private key.
slamm@google.com [Tue, 29 May 2012 20:11:21 +0000 (20:11 +0000)]
For SPDY, use the generated certfile that contains the private key.

Make --spdy a boolean flag and rely on --no-ssl to turn off ssl.
Drop "-s" for --spdy. The former does not really save much typing.

BUG=25
TEST=

Review URL: https://chromiumcodereview.appspot.com/10453042

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@472 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoUse 100 queue slots for all platforms.
slamm@google.com [Tue, 29 May 2012 20:10:32 +0000 (20:10 +0000)]
Use 100 queue slots for all platforms.

BUG=25
TEST=

Review URL: https://chromiumcodereview.appspot.com/10443038

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@471 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoAdd timeout to pings.
slamm@google.com [Fri, 25 May 2012 16:52:50 +0000 (16:52 +0000)]
Add timeout to pings.
Check for working ping command (OsX Lion has added restrictions.)

BUG=25
TEST=

Review URL: https://chromiumcodereview.appspot.com/10451032

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@470 164481a5-15cb-f69f-4b93-856c5b7754c5

11 months agoUpdate httparchive_test for create_response API change.
slamm@google.com [Wed, 23 May 2012 21:43:19 +0000 (21:43 +0000)]
Update httparchive_test for create_response API change.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10436003

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@469 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoContent length does not apply to chunked results.
tonyg@google.com [Tue, 22 May 2012 00:00:25 +0000 (00:00 +0000)]
Content length does not apply to chunked results.

Review URL: http://codereview.chromium.org/10392190

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@468 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoFix deterministic script injection.
tonyg@google.com [Mon, 21 May 2012 23:22:05 +0000 (23:22 +0000)]
Fix deterministic script injection.

1. Only inject within the first 256 chars of the response. msn.com has a script which is
transferred with the wrong content-type (text/html) and has a string containing "<html>".
This patch avoids incorrectly injecting in that case.
2. Update content-length header after injection. Previously, the content was truncated
by the length of the injected script. This was causing www.youtube.com, espn.go.com and
possibly other sites to hang indefinitely.

Review URL: http://codereview.chromium.org/10411060

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@467 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoFor "httparchive.py cat ...", label the parts, and add "[binary data]",
slamm@google.com [Wed, 9 May 2012 22:50:22 +0000 (22:50 +0000)]
For "httparchive.py cat ...", label the parts, and add "[binary data]",
to show response body it skipped.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10209006

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@466 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoUpdate setup.py docstring instructions.
slamm@google.com [Wed, 9 May 2012 21:22:53 +0000 (21:22 +0000)]
Update setup.py docstring instructions.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@465 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoMake get_primary_dns() work on both Snow Leopard *and* Lion.
slamm@google.com [Wed, 9 May 2012 17:44:20 +0000 (17:44 +0000)]
Make get_primary_dns() work on both Snow Leopard *and* Lion.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10389032

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@464 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoMove complexity of context manager into servermanager.
slamm@google.com [Mon, 7 May 2012 22:31:19 +0000 (22:31 +0000)]
Move complexity of context manager into servermanager.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10375002

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@463 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoPut nbhttp license in first 60 lines so it is recognized by Chrome's
slamm@google.com [Mon, 7 May 2012 21:37:30 +0000 (21:37 +0000)]
Put nbhttp license in first 60 lines so it is recognized by Chrome's
licensecheck.pl script.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10386015

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@462 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoRefer to correct license: ISC.
slamm@google.com [Mon, 7 May 2012 20:19:07 +0000 (20:19 +0000)]
Refer to correct license: ISC.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@461 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoBump easy_install package to version 1.1. Pull in fixes to --record and proper shutdown.
slamm@google.com [Thu, 3 May 2012 23:42:13 +0000 (23:42 +0000)]
Bump easy_install package to version 1.1. Pull in fixes to --record and proper shutdown.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@460 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoDocstring tweak.
slamm@google.com [Thu, 3 May 2012 23:06:28 +0000 (23:06 +0000)]
Docstring tweak.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@459 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoQuick fix for contextmanger items. Need try-finally. Otherwise, an exception will...
slamm@google.com [Thu, 3 May 2012 22:39:57 +0000 (22:39 +0000)]
Quick fix for contextmanger items. Need try-finally. Otherwise, an exception will cause code after yield to get skipped (not what I had expected).

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@458 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoFix errors in record mode introduced by my recent changes.
slamm@google.com [Thu, 3 May 2012 22:22:00 +0000 (22:22 +0000)]
Fix errors in record mode introduced by my recent changes.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@457 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoAdd license boilerplate to ipaddr/test-2to3.sh.
slamm@google.com [Mon, 30 Apr 2012 20:47:14 +0000 (20:47 +0000)]
Add license boilerplate to ipaddr/test-2to3.sh.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@456 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoAdd license
slamm@google.com [Mon, 30 Apr 2012 19:42:48 +0000 (19:42 +0000)]
Add license

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@455 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoAdd ipaddr sources to WPR tree (instead of using svn:externals).
slamm@google.com [Fri, 27 Apr 2012 17:42:28 +0000 (17:42 +0000)]
Add ipaddr sources to WPR tree (instead of using svn:externals).
This will make it easier to include WPR source in other projects like Chromium.
Review URL: https://chromiumcodereview.appspot.com/10180010

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@454 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoRemove svn:executable property on files with no main method.
tonyg@google.com [Wed, 25 Apr 2012 10:16:13 +0000 (10:16 +0000)]
Remove svn:executable property on files with no main method.
Review URL: https://chromiumcodereview.appspot.com/10166031

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@453 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoFixes for Python egg.
slamm@google.com [Tue, 24 Apr 2012 22:38:38 +0000 (22:38 +0000)]
Fixes for Python egg.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10201003

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@452 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoServer delay changes:
slamm@google.com [Tue, 24 Apr 2012 18:37:41 +0000 (18:37 +0000)]
Server delay changes:
* Move delay placement:
  - was: delay_0, headers, chunk_1, delay_1, ..., chunk_n, delay_n, chunk_zero_length
  - now: delay_0, headers, delay_1, chunk_1, ..., delay_n, chunk_n, chunk_zero_length
* Split ArchivedHttpResponse.server_delays into .headers_delay and .data_delays.
* Record the delay as time between chunks instead of chunk start to start.
* On record, only subtract server_rtt from first delay (had subtracted from every delay).
* On playback, make initial delay before writing headers (was at end of headers).
* Add delay info to "httparchive.py cat ...."

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10204006

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@451 164481a5-15cb-f69f-4b93-856c5b7754c5

12 months agoCopy response only if inject succeeds.
slamm@google.com [Mon, 23 Apr 2012 23:11:25 +0000 (23:11 +0000)]
Copy response only if inject succeeds.
Avoid changing archive even in playback.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10161011

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@450 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoFix bug in httparchive.create_response. Body needs to be a list of content.
slamm@google.com [Fri, 20 Apr 2012 23:25:18 +0000 (23:25 +0000)]
Fix bug in httparchive.create_response. Body needs to be a list of content.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@449 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoAdd import needed for r447.
slamm@google.com [Thu, 19 Apr 2012 21:09:37 +0000 (21:09 +0000)]
Add import needed for r447.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@448 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoAdd a setup script for creating a python egg.
tonyg@google.com [Wed, 18 Apr 2012 10:17:49 +0000 (10:17 +0000)]
Add a setup script for creating a python egg.

See comment in setup.py for usage.

BUG=22
Review URL: http://codereview.chromium.org/10103033

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@447 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoFix setting up SSL.
slamm@google.com [Fri, 13 Apr 2012 13:04:52 +0000 (13:04 +0000)]
Fix setting up SSL.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/10069018

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@446 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoQuit if port already in use.
slamm@google.com [Fri, 6 Apr 2012 20:39:49 +0000 (20:39 +0000)]
Quit if port already in use.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9969133

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@445 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoUse fixed paths for subprocess commands (to improve security).
slamm@google.com [Wed, 4 Apr 2012 17:21:11 +0000 (17:21 +0000)]
Use fixed paths for subprocess commands (to improve security).
BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9950123

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@444 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoClean-up temporary certificate file.
slamm@google.com [Wed, 4 Apr 2012 17:16:58 +0000 (17:16 +0000)]
Clean-up temporary certificate file.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9956122

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@443 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoAdd ArchivedHttpResponse.create_response() convenience method.
slamm@google.com [Wed, 4 Apr 2012 16:49:49 +0000 (16:49 +0000)]
Add ArchivedHttpResponse.create_response() convenience method.
Rework handling of conditional requests (fixed one bug in the process).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9950121

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@442 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoTweak last commit (fix _check_output call).
slamm@google.com [Mon, 26 Mar 2012 21:34:58 +0000 (21:34 +0000)]
Tweak last commit (fix _check_output call).

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@440 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoTurn SSL on by default. Automatically generate cert on Mac/Linux.
slamm@google.com [Mon, 26 Mar 2012 21:30:30 +0000 (21:30 +0000)]
Turn SSL on by default. Automatically generate cert on Mac/Linux.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9866004

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@439 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoAdd trafficshaping to SSL traffic.
slamm@google.com [Mon, 26 Mar 2012 19:53:00 +0000 (19:53 +0000)]
Add trafficshaping to SSL traffic.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9858021

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@437 164481a5-15cb-f69f-4b93-856c5b7754c5

13 months agoUpdate custom handlers to return responses instead of status codes.
slamm@google.com [Mon, 26 Mar 2012 19:46:37 +0000 (19:46 +0000)]
Update custom handlers to return responses instead of status codes.
Add handler for reporting WPR status.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9824003

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@436 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoPut all the option hacks together under class OptionWrapper.
slamm@google.com [Fri, 9 Mar 2012 18:07:47 +0000 (18:07 +0000)]
Put all the option hacks together under class OptionWrapper.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9657017

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@432 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoTweak scheme ternary expression. (take 2)
slamm@google.com [Thu, 8 Mar 2012 18:16:13 +0000 (18:16 +0000)]
Tweak scheme ternary expression. (take 2)

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@429 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoTweak scheme ternary expression
slamm@google.com [Thu, 8 Mar 2012 18:16:08 +0000 (18:16 +0000)]
Tweak scheme ternary expression

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@428 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoAdd http:// or https:// to "httparchive.py ls".
slamm@google.com [Thu, 8 Mar 2012 18:16:03 +0000 (18:16 +0000)]
Add http:// or https:// to "httparchive.py ls".

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@427 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoDistinguish SSL requests from non-SSL requests.
slamm@google.com [Thu, 8 Mar 2012 18:15:56 +0000 (18:15 +0000)]
Distinguish SSL requests from non-SSL requests.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@426 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoUndo _InjectScripts changes.
slamm@google.com [Thu, 8 Mar 2012 18:15:49 +0000 (18:15 +0000)]
Undo _InjectScripts changes.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@425 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoUndo _InjectScripts changes.
slamm@google.com [Thu, 8 Mar 2012 18:15:41 +0000 (18:15 +0000)]
Undo _InjectScripts changes.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@424 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoAdd SSL support.
slamm@google.com [Thu, 8 Mar 2012 18:15:36 +0000 (18:15 +0000)]
Add SSL support.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@423 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoOnly rerun as root if running in some mode that typically requires root.
tonyg@google.com [Thu, 8 Mar 2012 13:55:12 +0000 (13:55 +0000)]
Only rerun as root if running in some mode that typically requires root.

There are some valid ways to run the server which don't require root at all.
This patch allows those to continue to work.

TBR=slamm@google.com
Review URL: https://chromiumcodereview.appspot.com/9630010

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@422 164481a5-15cb-f69f-4b93-856c5b7754c5

14 months agoAdd SSL support.
slamm@google.com [Mon, 5 Mar 2012 17:44:46 +0000 (17:44 +0000)]
Add SSL support.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9585023

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@421 164481a5-15cb-f69f-4b93-856c5b7754c5

15 months agoIf not running as administrator, rerun as administrator (if possible).
slamm@google.com [Wed, 15 Feb 2012 00:19:39 +0000 (00:19 +0000)]
If not running as administrator, rerun as administrator (if possible).

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9398005

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@420 164481a5-15cb-f69f-4b93-856c5b7754c5

15 months agoAdd easy option (--net=dsl|cable|fios) for network settings.
slamm@google.com [Tue, 14 Feb 2012 19:06:42 +0000 (19:06 +0000)]
Add easy option (--net=dsl|cable|fios) for network settings.

BUG=
TEST=

Review URL: https://chromiumcodereview.appspot.com/9388023

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@419 164481a5-15cb-f69f-4b93-856c5b7754c5

19 months agoAdhere to the "SPDY Protocol - Draft 2" (section: HTTP Layering over SPDY) and use...
slamm@google.com [Fri, 14 Oct 2011 17:03:26 +0000 (17:03 +0000)]
Adhere to the "SPDY Protocol - Draft 2" (section: HTTP Layering over SPDY) and use lowercase header names.

Review URL: http://codereview.chromium.org/8288001

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@416 164481a5-15cb-f69f-4b93-856c5b7754c5

19 months agoDrop unnecessary request_header arg for fetching resources. The request object alread...
slamm@google.com [Thu, 13 Oct 2011 20:51:50 +0000 (20:51 +0000)]
Drop unnecessary request_header arg for fetching resources. The request object already has the headers.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@415 164481a5-15cb-f69f-4b93-856c5b7754c5

19 months agoBring SPDY uptodate:
slamm@google.com [Thu, 13 Oct 2011 16:08:30 +0000 (16:08 +0000)]
Bring SPDY uptodate:
  . Update ReplayHttpArchiveFetch options for SPDY.
  . Add headers to ArchivedHttpRequest.

BUG=
TEST=

Review URL: http://codereview.chromium.org/8246003

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@414 164481a5-15cb-f69f-4b93-856c5b7754c5

20 months agoHandle injection errors at replay time more gracefully.
tonyg@google.com [Thu, 1 Sep 2011 14:44:36 +0000 (14:44 +0000)]
Handle injection errors at replay time more gracefully.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@413 164481a5-15cb-f69f-4b93-856c5b7754c5

20 months agoAdd retry logic when recording.
tonyg@google.com [Tue, 30 Aug 2011 09:34:49 +0000 (09:34 +0000)]
Add retry logic when recording.
Review URL: http://codereview.chromium.org/7760003

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@411 164481a5-15cb-f69f-4b93-856c5b7754c5

20 months agoDon't save script injects in the archive. Inject dynamically at record and
tonyg@google.com [Fri, 26 Aug 2011 15:01:28 +0000 (15:01 +0000)]
Don't save script injects in the archive. Inject dynamically at record and
replay time. Also fix a bug in "httparchive.py cat".
Review URL: http://codereview.chromium.org/7753034

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@410 164481a5-15cb-f69f-4b93-856c5b7754c5

20 months agoAllow scripts to be injected from the command line.
tonyg@google.com [Wed, 24 Aug 2011 11:11:55 +0000 (11:11 +0000)]
Allow scripts to be injected from the command line.
Review URL: http://codereview.chromium.org/7701005

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@409 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoFixed how proxy requests are handled.
towlarn@google.com [Thu, 11 Aug 2011 20:24:12 +0000 (20:24 +0000)]
Fixed how proxy requests are handled.

Absolute URLs sent from proxy requests are stripped down to relative URLs. This allows requests recorded in 'proxy mode' (where the browser has WPR set as a proxy) to be played back on 'non-proxy mode' and vice versa.

Added 'proxy-connection' to headers trimmed.
Review URL: http://codereview.chromium.org/7620017

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@406 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoImplemented server delay simulation.
towlarn@google.com [Thu, 11 Aug 2011 18:22:45 +0000 (18:22 +0000)]
Implemented server delay simulation.

Time to first byte is measured and recorded for each chunk (for HTTP Chunked
connections). This time is then simulated during playback mode.

Servers are pinged to measure round trip time, and this rtt is subtracted from
the total delay to calculate server time.

Users can manually edit server delays for every chunk via httparchive's edit
command.

e.g. httparchive edit --host [hostname] --path [pathname] [archive file]

Usage of server delay is optional. Users can trigger it with the command line flag --use-server-delay via replay.py
Review URL: http://codereview.chromium.org/7491069

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@405 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoFix typo.
slamm@google.com [Wed, 10 Aug 2011 17:35:45 +0000 (17:35 +0000)]
Fix typo.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@404 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoreverted back to r401
towlarn@google.com [Fri, 5 Aug 2011 22:35:44 +0000 (22:35 +0000)]
reverted back to r401

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@403 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoImplemented server delay simulation.
towlarn@google.com [Fri, 5 Aug 2011 22:18:48 +0000 (22:18 +0000)]
Implemented server delay simulation.

Time to first byte is measured and recorded for each chunk (for HTTP Chunked connections). This time is then simulated during playback mode.

Servers are pinged to measure round trip time, and this rtt is subtracted from the total delay to calculate server time.

Users can manually edit server delays for every chunk via httparchive's edit command.

e.g. httparchive edit --host [hostname] --path [pathname] [archive file]
Review URL: http://codereview.chromium.org/7540034

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@402 164481a5-15cb-f69f-4b93-856c5b7754c5

21 months agoImplemented a change to serve the "closest match" request instead of returning a...
towlarn@google.com [Mon, 1 Aug 2011 19:26:22 +0000 (19:26 +0000)]
Implemented a change to serve the "closest match" request instead of returning a 404.

Added unit tests for cache archive implementation (cachemissarchive) and httparchive.
Review URL: http://codereview.chromium.org/7467010

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@401 164481a5-15cb-f69f-4b93-856c5b7754c5

22 months agoUncommented virtual display
towlarn@google.com [Wed, 20 Jul 2011 21:16:08 +0000 (21:16 +0000)]
Uncommented virtual display

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@398 164481a5-15cb-f69f-4b93-856c5b7754c5

22 months agoModified Javascript injection to handle some possible race conditions in a more robus...
towlarn@google.com [Wed, 20 Jul 2011 21:04:03 +0000 (21:04 +0000)]
Modified Javascript injection to handle some possible race conditions in a more robust manner

If WPR has already archived a request-response pair, it will now return the appropriate response on an archived request

Added replay support for the following headers:
if-modified-since, if-unmodified-since, if-none-match, if-match

Added an archiver to record WPR replay misses.

Added a script (using Perftracker) to run record/replay mode on WPR and record any replay misses using the archiver.
Review URL: http://codereview.chromium.org/7206068

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@397 164481a5-15cb-f69f-4b93-856c5b7754c5

22 months agoMake "git status" ingore *.pyc files.
slamm@google.com [Mon, 11 Jul 2011 16:37:05 +0000 (16:37 +0000)]
Make "git status" ingore *.pyc files.

git-svn-id: http://web-page-replay.googlecode.com/svn/trunk@396 164481a5-15cb-f69f-4b93-856c5b7754c5