mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-25 01:47:38 +00:00
Remove last CR in receive_message()
SVN revision: 700
This commit is contained in:
parent
164d19f0ce
commit
61b245d320
23
src/elogd.c
23
src/elogd.c
@ -6,6 +6,9 @@
|
|||||||
Contents: Web server program for Electronic Logbook ELOG
|
Contents: Web server program for Electronic Logbook ELOG
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.203 2004/01/20 16:25:57 midas
|
||||||
|
Remove last CR in receive_message()
|
||||||
|
|
||||||
Revision 1.202 2004/01/20 15:50:06 midas
|
Revision 1.202 2004/01/20 15:50:06 midas
|
||||||
Changed error return from receive_message()
|
Changed error return from receive_message()
|
||||||
|
|
||||||
@ -8271,6 +8274,8 @@ int receive_message(LOGBOOK * lbs, char *url, int message_id, char *error_str, B
|
|||||||
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
attachment[MAX_ATTACHMENTS][MAX_PATH_LENGTH], encoding[80], locked_by[256],
|
||||||
attachment_all[64 * MAX_ATTACHMENTS];
|
attachment_all[64 * MAX_ATTACHMENTS];
|
||||||
|
|
||||||
|
error_str[0] = 0;
|
||||||
|
|
||||||
strlcpy(str, url, sizeof(str));
|
strlcpy(str, url, sizeof(str));
|
||||||
if (str[strlen(str) - 1] != '/')
|
if (str[strlen(str) - 1] != '/')
|
||||||
strlcat(str, "/", sizeof(str));
|
strlcat(str, "/", sizeof(str));
|
||||||
@ -8337,6 +8342,10 @@ int receive_message(LOGBOOK * lbs, char *url, int message_id, char *error_str, B
|
|||||||
if (p != NULL) {
|
if (p != NULL) {
|
||||||
p += 41;
|
p += 41;
|
||||||
|
|
||||||
|
/* remove last CR */
|
||||||
|
if (p[strlen(p)-1] == '\n')
|
||||||
|
p[strlen(p)-1] = 0;
|
||||||
|
|
||||||
status = el_submit(lbs, message_id, !bnew, date, attr_list,
|
status = el_submit(lbs, message_id, !bnew, date, attr_list,
|
||||||
attrib, lbs->n_attr, p, in_reply_to, reply_to,
|
attrib, lbs->n_attr, p, in_reply_to, reply_to,
|
||||||
encoding, attachment, FALSE, "");
|
encoding, attachment, FALSE, "");
|
||||||
@ -8479,7 +8488,7 @@ BOOL equal_md5(unsigned char m1[16], unsigned char m2[16])
|
|||||||
|
|
||||||
void synchronize(LOGBOOK * lbs, char *path)
|
void synchronize(LOGBOOK * lbs, char *path)
|
||||||
{
|
{
|
||||||
int index, i, i_msg, i_remote, i_cache, n_remote, n_cache, nserver,
|
int index, i, j, i_msg, i_remote, i_cache, n_remote, n_cache, nserver,
|
||||||
remote_id, exist_remote, exist_cache, message_id;
|
remote_id, exist_remote, exist_cache, message_id;
|
||||||
int priority_remote = 0;
|
int priority_remote = 0;
|
||||||
char str[2000];
|
char str[2000];
|
||||||
@ -8549,6 +8558,18 @@ void synchronize(LOGBOOK * lbs, char *path)
|
|||||||
/* if message exists in both lists, compare MD5s */
|
/* if message exists in both lists, compare MD5s */
|
||||||
if (exist_remote && exist_cache) {
|
if (exist_remote && exist_cache) {
|
||||||
|
|
||||||
|
//##
|
||||||
|
printf("ID%02d: ", message_id);
|
||||||
|
for (j=0 ; j<16 ; j++)
|
||||||
|
printf("%02X", lbs->el_index[i_msg].md5_digest[j]);
|
||||||
|
printf("\nCache : ");
|
||||||
|
for (j=0 ; j<16 ; j++)
|
||||||
|
printf("%02X", md5_cache[i_cache].md5_digest[j]);
|
||||||
|
printf("\nRemote: ");
|
||||||
|
for (j=0 ; j<16 ; j++)
|
||||||
|
printf("%02X", md5_remote[i_remote].md5_digest[j]);
|
||||||
|
printf("\n\n");
|
||||||
|
|
||||||
/* if message has been changed on this server, but not remotely, send it */
|
/* if message has been changed on this server, but not remotely, send it */
|
||||||
if (!equal_md5(md5_cache[i_cache].md5_digest, lbs->el_index[i_msg].md5_digest)
|
if (!equal_md5(md5_cache[i_cache].md5_digest, lbs->el_index[i_msg].md5_digest)
|
||||||
&& equal_md5(md5_cache[i_cache].md5_digest,
|
&& equal_md5(md5_cache[i_cache].md5_digest,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user