summaryrefslogtreecommitdiff
path: root/uclient-http.c
diff options
context:
space:
mode:
authorLuka Perkov <luka@openwrt.org>2014-07-07 10:11:41 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-07-07 10:24:52 +0200
commit0fa104b6042913eb3eae9bdddad1cf341c85e614 (patch)
tree46849444a448acc0516cccbc3f8dc405c818d8bf /uclient-http.c
parente1ed2c2250c89be3bed71f8bad038d5610178364 (diff)
downloaduclient-0fa104b6042913eb3eae9bdddad1cf341c85e614.tar.gz
http: implement data_sent write callback
Signed-off-by: Luka Perkov <luka@openwrt.org>
Diffstat (limited to 'uclient-http.c')
-rw-r--r--uclient-http.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/uclient-http.c b/uclient-http.c
index 1ab336f..47c890f 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -651,6 +651,12 @@ static void __uclient_notify_read(struct uclient_http *uh)
uc->cb->data_read(uc);
}
+static void __uclient_notify_write(struct uclient_http *uh)
+{
+ struct uclient *uc = &uh->uc;
+ uc->cb->data_sent(uc);
+}
+
static void uclient_notify_read(struct ustream *us, int bytes)
{
struct uclient_http *uh = container_of(us, struct uclient_http, ufd.stream);
@@ -658,6 +664,13 @@ static void uclient_notify_read(struct ustream *us, int bytes)
__uclient_notify_read(uh);
}
+static void uclient_notify_write(struct ustream *us, int bytes)
+{
+ struct uclient_http *uh = container_of(us, struct uclient_http, ufd.stream);
+
+ __uclient_notify_write(uh);
+}
+
static void uclient_notify_state(struct ustream *us)
{
struct uclient_http *uh = container_of(us, struct uclient_http, ufd.stream);
@@ -676,6 +689,7 @@ static int uclient_setup_http(struct uclient_http *uh)
us->string_data = true;
us->notify_state = uclient_notify_state;
us->notify_read = uclient_notify_read;
+ us->notify_write = uclient_notify_write;
ret = uclient_do_connect(uh, "80");
if (ret)
@@ -691,6 +705,13 @@ static void uclient_ssl_notify_read(struct ustream *us, int bytes)
__uclient_notify_read(uh);
}
+static void uclient_ssl_notify_write(struct ustream *us, int bytes)
+{
+ struct uclient_http *uh = container_of(us, struct uclient_http, ussl.stream);
+
+ __uclient_notify_write(uh);
+}
+
static void uclient_ssl_notify_state(struct ustream *us)
{
struct uclient_http *uh = container_of(us, struct uclient_http, ussl.stream);
@@ -744,6 +765,7 @@ static int uclient_setup_https(struct uclient_http *uh)
us->string_data = true;
us->notify_state = uclient_ssl_notify_state;
us->notify_read = uclient_ssl_notify_read;
+ us->notify_write = uclient_ssl_notify_write;
uh->ussl.notify_error = uclient_ssl_notify_error;
uh->ussl.notify_verify_error = uclient_ssl_notify_verify_error;
uh->ussl.notify_connected = uclient_ssl_notify_connected;