Skip to content

Conversation

@jukkar
Copy link
Member

@jukkar jukkar commented Aug 8, 2017

The http_response_send_data() can be used to send a chunk of data
to the peer.

Signed-off-by: Jukka Rissanen [email protected]

The http_response_send_data() can be used to send a chunk of data
to the peer.

Signed-off-by: Jukka Rissanen <[email protected]>
@jukkar jukkar added the net label Aug 8, 2017
@jukkar jukkar self-assigned this Aug 8, 2017
@jukkar jukkar requested a review from pfalcon August 8, 2017 08:38
@jukkar jukkar requested a review from tbursztyka as a code owner August 8, 2017 08:38
@jukkar
Copy link
Member Author

jukkar commented Aug 8, 2017

The motivation for this PR is that I needed to use this kind of functionality in #980

Copy link
Contributor

@pfalcon pfalcon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised there was no such function from the beginning - it's natural to generate HTTP response incrementally. Especially due to lack of MTU handling in send, so sending any sizable content will fail (https://jira.zephyrproject.org/browse/ZEP-1998).

However, this patch is a workaround at best. Normal workflow (IMHO) should be: 1) a function to send out headers; 2) a function to send next block of data, taking its length.

This patch stuffs both headers and data sending into one function, and expects ASCII string only. Weird.

I approve, because it's move in the right direction (but very slow ;-) ).

@jukkar
Copy link
Member Author

jukkar commented Aug 8, 2017

However, this patch is a workaround at best. Normal workflow (IMHO) should be: 1) a function to send out headers; 2) a function to send next block of data, taking its length.

I agree, we need to rework the HTTP APIs.

@jukkar jukkar merged commit 64562e1 into zephyrproject-rtos:master Aug 8, 2017
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.

2 participants