diff options
author | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-07 11:16:44 +0000 |
---|---|---|
committer | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-07 11:16:44 +0000 |
commit | 719620aa7ed036e846a08c813b63d4bdb85dc9dc (patch) | |
tree | c9c9e4c1345081ce94b684d485edb686037300d4 /src/my/my_result_helper.c | |
parent | 5c57b333fd9ca376e9ba2c1932127f733d684abb (diff) | |
download | gnunet-719620aa7ed036e846a08c813b63d4bdb85dc9dc.tar.gz gnunet-719620aa7ed036e846a08c813b63d4bdb85dc9dc.zip |
start to fix extract vsize
Diffstat (limited to 'src/my/my_result_helper.c')
-rw-r--r-- | src/my/my_result_helper.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/my/my_result_helper.c b/src/my/my_result_helper.c index 97cc1f1bf..2d2c18cec 100644 --- a/src/my/my_result_helper.c +++ b/src/my/my_result_helper.c | |||
@@ -40,7 +40,7 @@ pre_extract_varsize_blob (void *cls, | |||
40 | results[0].buffer = NULL; | 40 | results[0].buffer = NULL; |
41 | results[0].buffer_length = 0; | 41 | results[0].buffer_length = 0; |
42 | results[0].length = &rs->mysql_bind_output_length; | 42 | results[0].length = &rs->mysql_bind_output_length; |
43 | results[0].buffer_type = MYSQL_TYPE_BLOB; | 43 | // results[0].buffer_type = MYSQL_TYPE_BLOB; |
44 | 44 | ||
45 | return GNUNET_OK; | 45 | return GNUNET_OK; |
46 | } | 46 | } |
@@ -69,11 +69,16 @@ post_extract_varsize_blob (void *cls, | |||
69 | size_t size; | 69 | size_t size; |
70 | 70 | ||
71 | size = (size_t) rs->mysql_bind_output_length; | 71 | size = (size_t) rs->mysql_bind_output_length; |
72 | |||
72 | if (rs->mysql_bind_output_length != size) | 73 | if (rs->mysql_bind_output_length != size) |
73 | return GNUNET_SYSERR; /* 'unsigned long' does not fit in size_t!? */ | 74 | return GNUNET_SYSERR; /* 'unsigned long' does not fit in size_t!? */ |
74 | buf = GNUNET_malloc (size); | 75 | buf = GNUNET_malloc (size); |
76 | |||
75 | results[0].buffer = buf; | 77 | results[0].buffer = buf; |
76 | results[0].buffer_length = size; | 78 | results[0].buffer_length = size; |
79 | results[0].buffer_type = MYSQL_TYPE_BLOB; | ||
80 | |||
81 | fprintf(stderr, "size : %d\n", size); | ||
77 | 82 | ||
78 | if (0 != | 83 | if (0 != |
79 | mysql_stmt_fetch_column (stmt, | 84 | mysql_stmt_fetch_column (stmt, |
@@ -84,8 +89,12 @@ post_extract_varsize_blob (void *cls, | |||
84 | GNUNET_free (buf); | 89 | GNUNET_free (buf); |
85 | return GNUNET_SYSERR; | 90 | return GNUNET_SYSERR; |
86 | } | 91 | } |
92 | |||
93 | printf("buf : %s\n", (char*)buf); | ||
94 | |||
87 | *(void **) rs->dst = buf; | 95 | *(void **) rs->dst = buf; |
88 | *rs->result_size = size; | 96 | *rs->result_size = size; |
97 | |||
89 | return GNUNET_OK; | 98 | return GNUNET_OK; |
90 | } | 99 | } |
91 | 100 | ||