diff options
author | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-06 16:11:56 +0000 |
---|---|---|
committer | Christophe Genevey Metat <genevey.christophe@gmail.com> | 2016-06-06 16:11:56 +0000 |
commit | 3b680a20ab2cbb98cfa658d85be7a44baaf95d2c (patch) | |
tree | 6217c36e0ace8a7892a0a1567f13e9985903c7d6 /src/my/my_result_helper.c | |
parent | 67dc0efd426a379b818155ed87f3c1a76d9e352f (diff) | |
download | gnunet-3b680a20ab2cbb98cfa658d85be7a44baaf95d2c.tar.gz gnunet-3b680a20ab2cbb98cfa658d85be7a44baaf95d2c.zip |
continue to fix extract result
Diffstat (limited to 'src/my/my_result_helper.c')
-rw-r--r-- | src/my/my_result_helper.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/my/my_result_helper.c b/src/my/my_result_helper.c index eafe434f8..97cc1f1bf 100644 --- a/src/my/my_result_helper.c +++ b/src/my/my_result_helper.c | |||
@@ -37,9 +37,10 @@ pre_extract_varsize_blob (void *cls, | |||
37 | unsigned int column, | 37 | unsigned int column, |
38 | MYSQL_BIND *results) | 38 | MYSQL_BIND *results) |
39 | { | 39 | { |
40 | results[0].buffer = 0; | 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 | 44 | ||
44 | return GNUNET_OK; | 45 | return GNUNET_OK; |
45 | } | 46 | } |
@@ -73,6 +74,7 @@ post_extract_varsize_blob (void *cls, | |||
73 | buf = GNUNET_malloc (size); | 74 | buf = GNUNET_malloc (size); |
74 | results[0].buffer = buf; | 75 | results[0].buffer = buf; |
75 | results[0].buffer_length = size; | 76 | results[0].buffer_length = size; |
77 | |||
76 | if (0 != | 78 | if (0 != |
77 | mysql_stmt_fetch_column (stmt, | 79 | mysql_stmt_fetch_column (stmt, |
78 | results, | 80 | results, |
@@ -235,10 +237,10 @@ pre_extract_rsa_public_key (void *cls, | |||
235 | MYSQL_BIND *results) | 237 | MYSQL_BIND *results) |
236 | 238 | ||
237 | { | 239 | { |
238 | results[0].buffer = 0; | 240 | results[0].buffer = NULL; |
239 | results[0].buffer_length = 0; | 241 | results[0].buffer_length = 0; |
240 | results[0].length = rs->mysql_bind_output_length; | 242 | results[0].length = &rs->mysql_bind_output_length; |
241 | results[0].buffer_type = MYSQL_TYPE_LONG; | 243 | results[0].buffer_type = MYSQL_TYPE_BLOB; |
242 | 244 | ||
243 | return GNUNET_OK; | 245 | return GNUNET_OK; |
244 | } | 246 | } |
@@ -292,9 +294,6 @@ post_extract_rsa_public_key (void *cls, | |||
292 | return GNUNET_SYSERR; | 294 | return GNUNET_SYSERR; |
293 | } | 295 | } |
294 | 296 | ||
295 | if (rs->dst_size != rs->mysql_bind_output_length) | ||
296 | return GNUNET_SYSERR; | ||
297 | |||
298 | return GNUNET_OK; | 297 | return GNUNET_OK; |
299 | } | 298 | } |
300 | 299 | ||
@@ -366,7 +365,7 @@ pre_extract_rsa_signature (void *cls, | |||
366 | results[0].buffer = 0; | 365 | results[0].buffer = 0; |
367 | results[0].buffer_length = 0; | 366 | results[0].buffer_length = 0; |
368 | results[0].length = &rs->mysql_bind_output_length; | 367 | results[0].length = &rs->mysql_bind_output_length; |
369 | results[0].buffer_type = MYSQL_TYPE_LONG; | 368 | results[0].buffer_type = MYSQL_TYPE_BLOB; |
370 | 369 | ||
371 | return GNUNET_OK; | 370 | return GNUNET_OK; |
372 | } | 371 | } |
@@ -391,8 +390,8 @@ post_extract_rsa_signature (void *cls, | |||
391 | MYSQL_BIND *results) | 390 | MYSQL_BIND *results) |
392 | { | 391 | { |
393 | struct GNUNET_CRYPTO_RsaSignature **sig = rs->dst; | 392 | struct GNUNET_CRYPTO_RsaSignature **sig = rs->dst; |
394 | size_t size; | 393 | size_t size = 0 ; |
395 | const char *res; | 394 | char *res = NULL; |
396 | 395 | ||
397 | results[0].buffer = res; | 396 | results[0].buffer = res; |
398 | results[0].buffer_length = size; | 397 | results[0].buffer_length = size; |