ALT Linux Bugzilla
– Attachment 5180 Details for
Bug 26463
rpmhdrmemcache.so портит данные
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
показывает что блоб меняется после загрузки
rpmhdrmemcache-diag.patch (text/plain), 1.49 KB, created by
at@altlinux.org
on 2011-10-31 22:39:06 MSK
(
hide
)
Description:
показывает что блоб меняется после загрузки
Filename:
MIME Type:
Creator:
at@altlinux.org
Created:
2011-10-31 22:39:06 MSK
Size:
1.49 KB
patch
obsolete
>diff --git a/hdrcache.c b/hdrcache.c >index 5bcef1a..b0e16bc 100644 >--- a/hdrcache.c >+++ b/hdrcache.c >@@ -95,6 +95,15 @@ int make_key(const char *path, const struct stat *st, char *key) > static > const int hdrsize_max = (256 << 10); > >+static >+unsigned hash(const unsigned char *blob, int size) >+{ >+ unsigned h = 5381; >+ while (size-- > 0) >+ h = h * 33 + *blob++; >+ return h; >+} >+ > Header hdrcache_get(const char *path, const struct stat *st, unsigned *off) > { > if (initialize() < 0) >@@ -117,9 +126,9 @@ Header hdrcache_get(const char *path, const struct stat *st, unsigned *off) > mcdb_put(env, key, keysize, data, datasize); > } > void *blob = data->blob; >+ int blobsize = datasize - sizeof(struct cache_ent) + 1; > char ublob[hdrsize_max]; > if (data->vflags & V_LZO) { >- int blobsize = datasize - sizeof(struct cache_ent) + 1; > lzo_uint ublobsize = 0; > int rc = lzo1x_decompress(blob, blobsize, ublob, &ublobsize, NULL); > if (rc != LZO_E_OK || ublobsize < 1 || ublobsize > hdrsize_max) { >@@ -127,8 +136,11 @@ Header hdrcache_get(const char *path, const struct stat *st, unsigned *off) > return NULL; > } > blob = ublob; >+ blobsize = ublobsize; > } >+ fprintf(stderr, "blob %x (%d) hash 1: %x\n", *(unsigned *) blob, blobsize, hash(blob, blobsize)); > Header h = headerLoad(blob); >+ fprintf(stderr, "blob %x (%d) hash 2: %x\n", *(unsigned *) blob, blobsize, hash(blob, blobsize)); > if (h == NULL) { > fprintf(stderr, "%s %s: headerLoad failed\n", __func__, key); > return NULL;
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 26463
: 5180 |
5181