summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2011-11-21 01:00:15 +0200
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2011-11-21 01:00:15 +0200
commit81a69a932806a138712e77f019d44ba1f9a43ff1 (patch)
tree6379fb3f32542a9e7b86e75e14c2b83abb4358a6 /server
parentad20d9d1519f7d03bca70f9b64c3a4bb17ba0df9 (diff)
fixed hashing
Diffstat (limited to 'server')
-rw-r--r--server/proxy_ui_server.workspace1
-rw-r--r--server/server/config.cpp13
2 files changed, 12 insertions, 2 deletions
diff --git a/server/proxy_ui_server.workspace b/server/proxy_ui_server.workspace
index 075d714..30e9c53 100644
--- a/server/proxy_ui_server.workspace
+++ b/server/proxy_ui_server.workspace
@@ -12,6 +12,7 @@
<Environment>
<![CDATA[
+
]]>
</Environment>
</CodeLite_Workspace>
diff --git a/server/server/config.cpp b/server/server/config.cpp
index 275f764..2f64d42 100644
--- a/server/server/config.cpp
+++ b/server/server/config.cpp
@@ -96,12 +96,21 @@ void config::load_upload_list(char *pth)
if(file.is_open())
{
char hash_buf[1024];
+ int l = 0;
while(!file.eof())
- MD5_Update(&c, hash_buf, file.readsome(hash_buf, 1024));
+ {
+ file.read(hash_buf, 1024);
+ MD5_Update(&c, hash_buf, file.gcount());
+ }
file.close();
unsigned char result[MD5_DIGEST_LENGTH];
MD5_Final(result, &c);
- hash = (char*)result;
+ char result_f;
+ for(int i = 0; i <MD5_DIGEST_LENGTH; i++)
+ {
+ sprintf(&result_f, "%02x",result[i]);
+ hash += result_f;
+ }
}
upload_list.push_back(upload_entry(source, destination, hash));
p2 = cfg_str.find(';', p1);