ALT Linux Bugzilla
– Attachment 3321 Details for
Bug 18861
новая версия ctorrent
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
filesize fix patch from the previos version
ctorrent-dnh3.3.2-filesize.patch (text/plain), 2.54 KB, created by
Andrew Clark
on 2009-02-17 22:30:24 MSK
(
hide
)
Description:
filesize fix patch from the previos version
Filename:
MIME Type:
Creator:
Andrew Clark
Created:
2009-02-17 22:30:24 MSK
Size:
2.54 KB
patch
obsolete
>diff -ur ctorrent-dnh3.2/bencode.cpp ctorrent-build/bencode.cpp >--- ctorrent-dnh3.2/bencode.cpp 2007-08-22 13:54:56 +0400 >+++ ctorrent-build/bencode.cpp 2008-01-15 23:14:42 +0300 >@@ -201,6 +201,17 @@ > return (EOF == fputc('e', fp)) ? 0: 1; > } > >+size_t bencode_ullint(const unsigned long long int ullinteger, FILE *fp) >+{ >+ char buf[MAX_ULLINT_SIZ]; >+ if (EOF == fputc('i', fp)) return 0; >+ if (MAX_ULLINT_SIZ <= snprintf(buf, MAX_ULLINT_SIZ, "%llu", (unsigned long long)ullinteger)) { >+ return 0; >+ } >+ if (fwrite(buf, strlen(buf), 1, fp) != 1) return 0; >+ return (EOF == fputc('e', fp)) ? 0 : 1; >+} >+ > size_t bencode_begin_dict(FILE *fp) > { > return (EOF == fputc('d',fp)) ? 0 : 1; >diff -urN ctorrent-dnh3.3.2/bencode.h ctorrent-build/bencode.h >--- ctorrent-dnh3.3.2/bencode.h 2008-06-15 04:00:19 +0400 >+++ ctorrent-build/bencode.h 2009-02-03 22:07:46 +0300 >@@ -10,6 +10,7 @@ > #define KEYNAME_LISTSIZ 256 > > #define MAX_INT_SIZ 64 >+#define MAX_ULLINT_SIZ 64 > > #define QUERY_STR 0 > #define QUERY_INT 1 >@@ -29,6 +30,7 @@ > size_t bencode_buf(const char *str,size_t len,FILE *fp); > size_t bencode_str(const char *str, FILE *fp); > size_t bencode_int(const uint64_t integer, FILE *fp); >+size_t bencode_ullint(const unsigned long long int ullinteger, FILE *fp); > size_t bencode_begin_dict(FILE *fp); > size_t bencode_begin_list(FILE *fp); > size_t bencode_end_dict_list(FILE *fp); >diff -ur ctorrent-dnh3.2/btfiles.cpp ctorrent-build/btfiles.cpp >--- ctorrent-dnh3.2/btfiles.cpp 2007-08-22 13:54:56 +0400 >+++ ctorrent-build/btfiles.cpp 2008-01-15 23:16:24 +0300 >@@ -700,7 +700,7 @@ > > }else{ > if( bencode_str("length", fp) != 1 ) return 0; >- if( bencode_int(m_btfhead->bf_length, fp) != 1) return 0; >+ if (bencode_ullint(m_btfhead->bf_length, fp) != 1) return 0; > > if( bencode_str("name", fp) != 1 ) return 0; > return bencode_str(m_btfhead->bf_filename, fp); >diff -ur ctorrent-dnh3.2/btfiles.h ctorrent-build/btfiles.h >--- ctorrent-dnh3.2/btfiles.h 2007-08-22 13:54:56 +0400 >+++ ctorrent-build/btfiles.h 2008-01-14 16:50:45 +0300 >@@ -33,7 +33,7 @@ > > BTFILE *m_btfhead; > char *m_directory; >- uint64_t m_total_files_length; >+ off_t m_total_files_length; > size_t m_total_opened; // already opened > size_t m_nfiles; > BTFILE **m_file; >@@ -64,7 +64,7 @@ > const char *saveas); > > char *GetDataName() const; >- uint64_t GetTotalLength() const { return m_total_files_length; } >+ off_t GetTotalLength() const { return m_total_files_length; } > ssize_t IO(char *buf, uint64_t off, size_t len, const int iotype); > size_t FillMetaInfo(FILE* fp);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 18861
:
3320
| 3321 |
3322
|
3323