diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:23:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:23:57 +0000 |
commit | e310c6fb680eb33b2f1dbea5d88ca13d3536e160 (patch) | |
tree | 3c92f23f7de71b395ef3a622a13fb0a4f9925665 /src | |
parent | 6726d9c371e0dbf4a3604c34e4a6043332372bd4 (diff) | |
download | gnunet-e310c6fb680eb33b2f1dbea5d88ca13d3536e160.tar.gz gnunet-e310c6fb680eb33b2f1dbea5d88ca13d3536e160.zip |
fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/fs/fs_publish.c | 3 | ||||
-rw-r--r-- | src/fs/fs_tree.c | 2 | ||||
-rw-r--r-- | src/fs/fs_uri.c | 10 |
3 files changed, 9 insertions, 6 deletions
diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 8417f6082..422984ecb 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c | |||
@@ -210,7 +210,8 @@ signal_publish_completion (struct GNUNET_FS_FileInformation *p, | |||
210 | struct GNUNET_FS_ProgressInfo pi; | 210 | struct GNUNET_FS_ProgressInfo pi; |
211 | 211 | ||
212 | pi.status = GNUNET_FS_STATUS_PUBLISH_COMPLETED; | 212 | pi.status = GNUNET_FS_STATUS_PUBLISH_COMPLETED; |
213 | make_publish_status (&pi, sc, p, p->chk_uri->data.chk.file_length); | 213 | make_publish_status (&pi, sc, p, |
214 | GNUNET_ntohll (p->chk_uri->data.chk.file_length)); | ||
214 | pi.value.publish.eta = GNUNET_TIME_UNIT_ZERO; | 215 | pi.value.publish.eta = GNUNET_TIME_UNIT_ZERO; |
215 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; | 216 | pi.value.publish.specifics.completed.chk_uri = p->chk_uri; |
216 | p->client_info | 217 | p->client_info |
diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 5d6a4f1d9..f5205f082 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c | |||
@@ -347,7 +347,7 @@ void GNUNET_FS_tree_encoder_next (struct GNUNET_FS_TreeEncoder * te) | |||
347 | te->uri = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); | 347 | te->uri = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); |
348 | te->uri->type = chk; | 348 | te->uri->type = chk; |
349 | te->uri->data.chk.chk = te->chk_tree[0]; | 349 | te->uri->data.chk.chk = te->chk_tree[0]; |
350 | te->uri->data.chk.file_length = te->size; | 350 | te->uri->data.chk.file_length = GNUNET_htonll (te->size); |
351 | GNUNET_SCHEDULER_add_continuation (te->h->sched, | 351 | GNUNET_SCHEDULER_add_continuation (te->h->sched, |
352 | GNUNET_NO, | 352 | GNUNET_NO, |
353 | te->cont, | 353 | te->cont, |
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 47bad3454..7959c37af 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -396,6 +396,7 @@ uri_chk_parse (const char *s, char **emsg) | |||
396 | struct GNUNET_FS_Uri *ret; | 396 | struct GNUNET_FS_Uri *ret; |
397 | struct FileIdentifier fi; | 397 | struct FileIdentifier fi; |
398 | unsigned int pos; | 398 | unsigned int pos; |
399 | unsigned long long flen; | ||
399 | size_t slen; | 400 | size_t slen; |
400 | char h1[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; | 401 | char h1[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; |
401 | char h2[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; | 402 | char h2[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; |
@@ -429,12 +430,12 @@ uri_chk_parse (const char *s, char **emsg) | |||
429 | &fi.chk.query)) || | 430 | &fi.chk.query)) || |
430 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], | 431 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], |
431 | "%llu", | 432 | "%llu", |
432 | &fi.file_length))) | 433 | &flen)) ) |
433 | { | 434 | { |
434 | *emsg = GNUNET_strdup (_("Malformed CHK URI")); | 435 | *emsg = GNUNET_strdup (_("Malformed CHK URI")); |
435 | return NULL; | 436 | return NULL; |
436 | } | 437 | } |
437 | fi.file_length = GNUNET_htonll (fi.file_length); | 438 | fi.file_length = GNUNET_htonll (flen); |
438 | ret = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); | 439 | ret = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); |
439 | ret->type = chk; | 440 | ret->type = chk; |
440 | ret->data.chk = fi; | 441 | ret->data.chk = fi; |
@@ -544,6 +545,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
544 | unsigned int pos; | 545 | unsigned int pos; |
545 | unsigned int npos; | 546 | unsigned int npos; |
546 | unsigned long long exptime; | 547 | unsigned long long exptime; |
548 | unsigned long long flen; | ||
547 | struct GNUNET_TIME_Absolute et; | 549 | struct GNUNET_TIME_Absolute et; |
548 | struct GNUNET_CRYPTO_RsaSignature sig; | 550 | struct GNUNET_CRYPTO_RsaSignature sig; |
549 | struct LocUriAssembly ass; | 551 | struct LocUriAssembly ass; |
@@ -578,12 +580,12 @@ uri_loc_parse (const char *s, char **emsg) | |||
578 | &ass.fi.chk.query)) || | 580 | &ass.fi.chk.query)) || |
579 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], | 581 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], |
580 | "%llu", | 582 | "%llu", |
581 | &ass.fi.file_length)) ) | 583 | &flen)) ) |
582 | { | 584 | { |
583 | *emsg = GNUNET_strdup (_("SKS URI malformed")); | 585 | *emsg = GNUNET_strdup (_("SKS URI malformed")); |
584 | return NULL; | 586 | return NULL; |
585 | } | 587 | } |
586 | ass.fi.file_length = GNUNET_htonll (ass.fi.file_length); | 588 | ass.fi.file_length = GNUNET_htonll (flen); |
587 | 589 | ||
588 | npos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2; | 590 | npos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2; |
589 | while ((s[npos] != '\0') && (s[npos] != '.')) | 591 | while ((s[npos] != '\0') && (s[npos] != '.')) |