mirror of
https://github.com/berlin-open-wireless-lab/DAWN.git
synced 2025-02-12 08:41:51 +00:00
network: rework network status callbacks
Exchange the code with the ustream example code: https://git.openwrt.org/?p=project/ustream-ssl.git;a=blob;f=ustream-example-client.c;h=4fc99f0356bddef3a22b31bf64015579e8eea447;hb=HEAD#l72 Signed-off-by: Nick Hainke <vincent@systemli.org>
This commit is contained in:
parent
10fb04317b
commit
9e8060ea09
1 changed files with 6 additions and 12 deletions
|
@ -70,14 +70,11 @@ static void client_notify_state(struct ustream *s) {
|
|||
dawnlog_debug_func("Entering...");
|
||||
|
||||
struct client *cl = container_of(s, struct client, s.stream);
|
||||
if (!s->eof)
|
||||
if (!s->write_error && !s->eof)
|
||||
return;
|
||||
|
||||
dawnlog_error("eof!, pending: %d, total: %d\n", s->w.data_bytes, cl->ctr);
|
||||
|
||||
if (!s->w.data_bytes)
|
||||
return client_close(s);
|
||||
|
||||
dawnlog_error("Closing client-connection, pending: %d, total: %d\n", s->w.data_bytes, cl->ctr);
|
||||
client_close(s);
|
||||
}
|
||||
|
||||
static void client_to_server_close(struct ustream *s) {
|
||||
|
@ -100,14 +97,11 @@ static void client_to_server_state(struct ustream *s) {
|
|||
|
||||
dawnlog_debug_func("Entering...");
|
||||
|
||||
if (!s->eof)
|
||||
if (!s->write_error && !s->eof)
|
||||
return;
|
||||
|
||||
dawnlog_error("eof!, pending: %d, total: %d\n", s->w.data_bytes, cl->ctr);
|
||||
|
||||
if (!s->w.data_bytes)
|
||||
return client_to_server_close(s);
|
||||
|
||||
dawnlog_error("Closing connection, pending: %d, total: %d\n", s->w.data_bytes, cl->ctr);
|
||||
client_to_server_close(s);
|
||||
}
|
||||
|
||||
static void client_read_cb(struct ustream *s, int bytes) {
|
||||
|
|
Loading…
Reference in a new issue