New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server won't take large things. Or something... #26

Closed
kyleterry opened this Issue Feb 21, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@kyleterry
Member

kyleterry commented Feb 21, 2014

$ curl -v -X POST -d @test_file.txt http://localhost:8080/turtles/test_book
* Hostname was NOT found in DNS cache
*   Trying ::1...
* connect to ::1 port 8080 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /turtles/test_book HTTP/1.1
> User-Agent: curl/7.35.0
> Host: localhost:8080
> Accept: */*
> Content-Length: 1215848
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
> 
< HTTP/1.1 404 Not Found
< Status: 404 Not Found
* Server OlegDB/fresh_cuts_n_jams is not blacklisted
< Server: OlegDB/fresh_cuts_n_jams
< Content-Length: 26
< Connection: close
< Content-Type: text/plain
< 
These aren't your ghosts.
* Closing connection 0
@qpfiffer

This comment has been minimized.

Show comment
Hide comment
@qpfiffer

qpfiffer Feb 21, 2014

Member

Curl send an "Expect: 100-continue" header, and then waits. After this it sends the data if the server responds with HTTP/1.1 100 Continue. This data is sent without the header.

I'll have to parse out the header first, note that the client is expecting a 100 back, and then branch to a different function to load in the actual data. Should be doable without too much trouble.

Member

qpfiffer commented Feb 21, 2014

Curl send an "Expect: 100-continue" header, and then waits. After this it sends the data if the server responds with HTTP/1.1 100 Continue. This data is sent without the header.

I'll have to parse out the header first, note that the client is expecting a 100 back, and then branch to a different function to load in the actual data. Should be doable without too much trouble.

@qpfiffer

This comment has been minimized.

Show comment
Hide comment
@qpfiffer

qpfiffer Feb 23, 2014

Member

Alright now it'll accept data but somewhere along the line it is being truncated.

Member

qpfiffer commented Feb 23, 2014

Alright now it'll accept data but somewhere along the line it is being truncated.

@qpfiffer qpfiffer closed this in 9d1f1c1 Feb 28, 2014

@qpfiffer

This comment has been minimized.

Show comment
Hide comment
@qpfiffer

qpfiffer Feb 28, 2014

Member

So curl doesn't like big binary files being shoved through it. I added a helper script to do this sort of thing that just uses requests, you'll find it in integrity_tests/large_file.py. Example usage:

./large_file.py 1391991186839.jpg image/jpg
Member

qpfiffer commented Feb 28, 2014

So curl doesn't like big binary files being shoved through it. I added a helper script to do this sort of thing that just uses requests, you'll find it in integrity_tests/large_file.py. Example usage:

./large_file.py 1391991186839.jpg image/jpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment