projects
/
framework
/
connectivity
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5b6c753
)
Use URI escape helpers for WISPr login request
author
Marcel Holtmann
<marcel@holtmann.org>
Sun, 7 Nov 2010 20:46:23 +0000
(
05:46
+0900)
committer
Marcel Holtmann
<marcel@holtmann.org>
Sun, 7 Nov 2010 20:46:23 +0000
(
05:46
+0900)
tools/wispr.c
patch
|
blob
|
history
diff --git
a/tools/wispr.c
b/tools/wispr.c
index
5e7a720
..
4b083cf
100644
(file)
--- a/
tools/wispr.c
+++ b/
tools/wispr.c
@@
-434,14
+434,25
@@
static gboolean wispr_input(const guint8 **data, gsize *length,
gpointer user_data)
{
struct wispr_session *wispr = user_data;
gpointer user_data)
{
struct wispr_session *wispr = user_data;
+ GString *buf;
+ gsize count;
+
+ buf = g_string_sized_new(100);
+
+ g_string_append(buf, "button=Login&UserName=");
+ g_string_append_uri_escaped(buf, wispr->username, NULL, FALSE);
+ g_string_append(buf, "&Password=");
+ g_string_append_uri_escaped(buf, wispr->password, NULL, FALSE);
+ g_string_append(buf, "&FNAME=0&OriginatingServer=");
+ g_string_append_uri_escaped(buf, wispr->originurl, NULL, FALSE);
+
+ count = buf->len;
g_free(wispr->formdata);
g_free(wispr->formdata);
- wispr->formdata = g_strdup_printf("button=Login&UserName=%s&"
- "Password=%s&FNAME=0&OriginatingServer=%s",
- wispr->username, wispr->password, wispr->originurl);
+ wispr->formdata = g_string_free(buf, FALSE);
*data = (guint8 *) wispr->formdata;
*data = (guint8 *) wispr->formdata;
- *length =
strlen(wispr->formdata)
;
+ *length =
count
;
return FALSE;
}
return FALSE;
}