[email protected] said:
> Please help with testing.  I've tagged my current head as
> polipo-20140107, and I've put a tarball and 32-bit Windows binary on
> 
>   http://www.pps.univ-paris-diderot.fr/~jch/software/files/polipo/

The current git master has some problems dealing with really large
requests (above 1895825408 bytes to be exact). It seems that any request
larger than this is truncated to this size.

When I use the following simple test server:

---cut here---
//
//  Test sever for stress testing large requests
//  Serves up zero-byte blobs of n MB at http://localhost:8080/get?s=n
//
//  Run with: go run test-largereq.go
//
package main

import (
        "fmt"
        "log"
        "net/http"
        "os"
        "io"
        "strconv"
        "time"
)

func main() {
        http.HandleFunc("/get", func(w http.ResponseWriter, r *http.Request) {
                size, _ := strconv.ParseInt(r.FormValue("s"), 10, 64)
                if (size <= 0) {
                  fmt.Fprintf(w, "Invalid size")
                        return
                }
                devzero, _ := os.Open("/dev/zero")
                rdr := io.NewSectionReader(devzero, 0, size * 1048576)
                http.ServeContent(w, r, "", time.Unix(1, 0), rdr)
  })

        log.Fatal(http.ListenAndServe(":8080", nil))
}
---cut here---

And then get 1000MB, and 10000MB using Polipo as a proxy:

$ http_proxy=localhost:8123 wget -O /dev/null http://localhost:8080/get?s=1000
--2014-01-08 17:09:36--  http://localhost:8080/get?s=1000
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8123... connected.
Proxy request sent, awaiting response... 200 OK
Length: 1048576000 (1000M) [application/octet-stream]
Saving to: `/dev/null'

100%[================================================>] 1,048,576,000  727M/s   
in 1.4s    

2014-01-08 17:09:37 (727 MB/s) - `/dev/null' saved [1048576000/1048576000]

$ http_proxy=localhost:8123 wget -O /dev/null http://localhost:8080/get?s=10000
--2014-01-08 17:09:38--  http://localhost:8080/get?s=10000
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8123... connected.
Proxy request sent, awaiting response... 200 OK
Length: 1895825408 (1.8G) [application/octet-stream]
Saving to: `/dev/null'

100%[================================================>] 1,895,825,408  742M/s   
in 2.4s    

2014-01-08 17:09:41 (742 MB/s) - `/dev/null' saved [1895825408/1895825408]

When wget is run without Polipo as a proxy I get the expected response:

$ wget -O /dev/null http://localhost:8080/get?s=10000
--2014-01-08 17:21:03--  http://localhost:8080/get?s=10000
Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 200 OK
Length: 10485760000 (9.8G) [application/octet-stream]
Saving to: `/dev/null'

100%[===============================================>] 10,485,760,000 2.52G/s   
in 3.9s    

2014-01-08 17:21:07 (2.50 GB/s) - `/dev/null' saved [10485760000/10485760000]

Martin

------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Polipo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/polipo-users

Reply via email to