[OpenWrt-Devel] [PATCH uclient] http: wait for socket to be ready before using it

Rafał Miłecki zajec5 at gmail.com
Thu Jan 15 07:25:19 EST 2015

On 15 January 2015 at 13:17, Felix Fietkau <nbd at openwrt.org> wrote:
> On 2015-01-15 12:50, Rafał Miłecki wrote:
>> This is required as we use USOCK_NONBLOCK.
> Are you sure? Theoretically, ustream should already handle it properly.
> The first write fails if the socket is not connected yet, so ustream
> will buffer the data and send it out again once epoll tells it that the
> fd is writable.

Maybe we were just thinking about different issues? See two of mine below:

1) time ./uclient-fetch
Downloading ''
Connecting to Unknown:32533
HTTP error 401
real    0m0.008s

(this Unknown:32533 should be IP + port)

2) time ./uclient-fetch
Downloading ''
Connecting to Unknown:32656
real    2m7.191s

(so it finally silently quits, but it takes 2 minutes, more than one
could want to wait)

openwrt-devel mailing list
openwrt-devel at lists.openwrt.org

More information about the openwrt-devel mailing list