Comments (8)
build cinatra_example and run this code with python 3:
import socket
import time
s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('127.0.0.1', 8080))
print('*Connected')
data1 = b'POST /upload_multipart HTTP/1.1\r\n' \
b'Host: 127.0.0.1\r\n' \
b'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Firefox/68.0\r\n' \
b'Accept: */*\r\n' \
b'Accept-Language: en-US,en;q=0.5\r\n' \
b'Accept-Encoding: gzip, deflate\r\n' \
b'Content-Type: multipart/form-data; boundary=---------------------------191691572411478\r\n' \
b'Content-Length: 925\r\n' \
b'Connection: keep-alive\r\n' \
b'Pragma: no-cache\r\n' \
b'Cache-Control: no-cache\r\n' \
b'\r\n' \
b'-----------------------------191691572411478\r\n' \
b'Content-Disposition: form-data; name="na'
data2 = b'me"\r\n' \
b'\r\n' \
b'plaintext_document_withlongname.txt\r\n' \
b'-----------------------------191691572411478\r\n' \
b'Content-Disposition: form-data; name="type"\r\n' \
b'\r\n' \
b'text/plain\r\n' \
b'-----------------------------191691572411478\r\n' \
b'Content-Disposition: form-data; name="size"\r\n' \
b'\r\n' \
b'259\r\n' \
b'-----------------------------191691572411478\r\n' \
b'Content-Disposition: form-data; name="lastModifiedDate"\r\n' \
b'\r\n' \
b'undefined\r\n' \
b'-----------------------------191691572411478\r\n' \
b'Content-Disposition: form-data; name="file"; filename="plaintext_docu'
data3 = b'ment_withlongname.txt"\r\n' \
b'Content-Type: text/plain\r\n' \
b'\r\n' \
b'The 2011 European Women Basketball Championship, commonly called EuroBasket Women 2011, was the 33rd regional championship held by FIBA Europe. The competition was held in Poland from 2011. This was the 4th time that the EuroBasket Women was hosted by Poland.\r\n' \
b'-----------------------------191691572411478--\r\n'
print (data1 + data2 + data3)
s.send(data1)
print('*SENT -A')
time.sleep(1)
s.send(data2)
print('*SENT -B')
time.sleep(1)
s.send(data3)
print('*SENT -C')
time.sleep(1)
s.close()
print('*Close')
from cinatra.
谢谢你提交issue,我会关注这个问题。
from cinatra.
可以在feed()函数第一句输出buffer地址来确认这个问题,可以发现对于单次post请求,确实会有概率多次触发feed()函数。
from cinatra.
用postman怎么做这个测试的?
from cinatra.
sorry我没有用postman,就在用firefox不断上传 27,046Bytes的图
from cinatra.
测试我觉得可以模拟网络丢包试下,也许可以看到分片了。。
还有可以用超长文件名,构建一个加长header。。
server端我是在feed()输出下第一个包的大小,如果第一个包差不多能把header分开,就在断点停一下。
(我更新了第一条,又加了一个bug)
from cinatra.
Hello, I submit a PR, could you have interesting to merge it after testing?...
(It also easy me to use this project)
from cinatra.
你能准备一个测试的页面或者程序发出来吗,我想先用你提供的测试程序看看问题,确定问题在哪儿,然后再看pr
from cinatra.
Related Issues (20)
- refactor cinatra server to support c++20 coroutine HOT 4
- 编译报错,‘_M_set_length’ is not a member of ‘std::string’ HOT 5
- 如何使用已有的io_context运行cinatra HOT 1
- 如何获取coro_http_client调接口 耗时 HOT 3
- Highly concurrent downloading of 2m js files will increase memory usage HOT 1
- websocket,1分钟没有消息交互,服务端会主动把链接掐断 HOT 2
- Windows visit Chinese filename not found
- 请问下,考虑支持unix套接字吗. HOT 10
- 是否可以让server对象的listen函数支持设置连接队列的长度? HOT 6
- bug: gcc resize_and_overwrite 導致髒數據的問題 HOT 21
- fatal error: 'asio/dispatch.hpp' file not found HOT 2
- https question HOT 18
- Failed to connect websocket with `Connection: upgrade` HOT 3
- [需求] 处理程序相关 HOT 12
- client URL 检测 的奇怪 bug HOT 7
- 上传二进制文件无法使用 HOT 2
- async_download 没有写入内容到文件 HOT 5
- 请问下,当链接断开时,如何获取到具体原因? HOT 3
- 【错误与需求】Nginx与chunked模式 HOT 16
- Access-Control-Allow-Origin
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cinatra.