revised ms journal handling

This commit is contained in:
SJ
2013-01-27 21:43:42 +01:00
parent e5618dd39b
commit 80cee9f59c
11 changed files with 53 additions and 63 deletions

View File

@@ -47,16 +47,10 @@ int make_digests(struct session_data *sdata, struct __config *cfg){
fd = open(sdata->filename, O_RDONLY);
if(fd == -1) return -1;
if(sdata->ms_journal == 1 && sdata->journal_envelope_length < sizeof(buf)){
n = read(fd, buf, sdata->journal_envelope_length);
}
while((n = read(fd, buf, sizeof(buf))) > 0){
len += n;
if(sdata->ms_journal == 1 && len > sdata->tot_len) n -= len - sdata->tot_len;
SHA256_Update(&context2, buf, n);
body = (char *)&buf[0];