Skip to content
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

File upload support in the HttpServer. #1792

Merged
merged 10 commits into from
Aug 2, 2019

Conversation

slaff
Copy link
Contributor

@slaff slaff commented Aug 1, 2019

No description provided.

@slaff slaff force-pushed the feature/httpserver-multipart-bodyparser branch from 208383c to e0eaead Compare August 1, 2019 19:35
@slaff slaff changed the title File upload support in the HttpServer. [WIP] File upload support in the HttpServer. Aug 1, 2019
@slaff slaff force-pushed the feature/httpserver-multipart-bodyparser branch from 37676a9 to 0d034d1 Compare August 1, 2019 20:31
@slaff slaff added this to the 4.0.0 milestone Aug 2, 2019
@slaff slaff changed the title [WIP] File upload support in the HttpServer. File upload support in the HttpServer. Aug 2, 2019
@mikee47
Copy link
Contributor

mikee47 commented Aug 2, 2019

I'm running this under the emulator (#1794 required) but data isn't getting into rBootItemOutputStream...

@slaff
Copy link
Contributor Author

slaff commented Aug 2, 2019

I'm running this under the emulator (#1794 required) but data isn't getting into rBootItemOutputStream...

Thanks for noticing this. Fetch the latest version of this PR and try again. Should work now.
And thanks a lot for the reorganization work. It is really nice way to organize optional components in Sming.

@mikee47
Copy link
Contributor

mikee47 commented Aug 2, 2019

I like this PR :-) Potentially extremely useful.

`useValue` remains set after parsing `Content-Disposition`, fails in `Content-Type` and aborts the entire thing.

With extra debug we now get this:

```
8969445 TCP received: 536 bytes
8969445 TCP onReadyToSendData: 1
8969445 The headers are complete
8969445 Mapped 'firmware' @ 0x00002000
8970422 TCP received: 107 bytes
8970422 TCP onReadyToSendData: 1
8972374 partBegin
8972374 readHeaderName('Content-Disposition')
8972374 readHeaderValue('form-data; name="firmware"; filename="App_Common.c"')
8972374 parser->name = 'firmware'
8972374 readHeaderName('Content-Type')
8972374 readHeaderValue('text/x-csrc')
8972374 partData(2 bytes)
flashmem_write: 0x00002000, 0
8972374 rboot_write_flash: item.size: 3
8973351 partData(2 bytes)
flashmem_write: 0x00002000, 4
8973351 rboot_write_flash: item.size: 5
8973351 partData(0 bytes)
8973351 rboot_write_flash: item.size: 5
8973351 partData(2 bytes)
flashmem_write: 0x00002004, 0
8973351 rboot_write_flash: item.size: 7
```
@slaff slaff removed the 3 - Review label Aug 2, 2019
@slaff slaff merged commit 0be2b33 into SmingHub:develop Aug 2, 2019
@slaff slaff mentioned this pull request Sep 28, 2019
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants