summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2015-01-21 22:48:35 +0100
committerFelix Fietkau <nbd@openwrt.org>2015-01-22 11:59:43 +0100
commit8d8c2e64db8c1e9f39bf79028da7f59fb33767f3 (patch)
treea62528d17e3f25800422b1991ba130b9efd79d48
parent6c222d0646fa7c07be96d729009916d5af295332 (diff)
downloaduclient-8d8c2e64db8c1e9f39bf79028da7f59fb33767f3.tar.gz
use const for char buffer in uclient_write
We are not supposed to modify it and ustream accepts const already. Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
-rw-r--r--uclient-backend.h2
-rw-r--r--uclient-http.c2
-rw-r--r--uclient.c2
-rw-r--r--uclient.h2
4 files changed, 4 insertions, 4 deletions
diff --git a/uclient-backend.h b/uclient-backend.h
index a5cf4f3..9ccc799 100644
--- a/uclient-backend.h
+++ b/uclient-backend.h
@@ -32,7 +32,7 @@ struct uclient_backend {
void (*disconnect)(struct uclient *cl);
int (*read)(struct uclient *cl, char *buf, unsigned int len);
- int (*write)(struct uclient *cl, char *buf, unsigned int len);
+ int (*write)(struct uclient *cl, const char *buf, unsigned int len);
};
void uclient_backend_set_error(struct uclient *cl, int code);
diff --git a/uclient-http.c b/uclient-http.c
index af43b05..9f9fac9 100644
--- a/uclient-http.c
+++ b/uclient-http.c
@@ -931,7 +931,7 @@ uclient_http_set_header(struct uclient *cl, const char *name, const char *value)
}
static int
-uclient_http_send_data(struct uclient *cl, char *buf, unsigned int len)
+uclient_http_send_data(struct uclient *cl, const char *buf, unsigned int len)
{
struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
diff --git a/uclient.c b/uclient.c
index d599763..21f6f5d 100644
--- a/uclient.c
+++ b/uclient.c
@@ -221,7 +221,7 @@ void uclient_free(struct uclient *cl)
free(url);
}
-int uclient_write(struct uclient *cl, char *buf, int len)
+int uclient_write(struct uclient *cl, const char *buf, int len)
{
if (!cl->backend->write)
return -1;
diff --git a/uclient.h b/uclient.h
index 5904a38..0c76f6e 100644
--- a/uclient.h
+++ b/uclient.h
@@ -106,7 +106,7 @@ int uclient_connect(struct uclient *cl);
void uclient_disconnect(struct uclient *cl);
int uclient_read(struct uclient *cl, char *buf, int len);
-int uclient_write(struct uclient *cl, char *buf, int len);
+int uclient_write(struct uclient *cl, const char *buf, int len);
int uclient_request(struct uclient *cl);
char *uclient_get_addr(char *dest, int *port, union uclient_addr *a);