mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added 'debug' facility for synchronize
SVN revision: 784
This commit is contained in:
parent
89554dfadb
commit
959cbec8ad
21
src/elogd.c
21
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.258 2004/02/17 20:09:36 midas
|
||||||
|
Added 'debug' facility for synchronize
|
||||||
|
|
||||||
Revision 1.257 2004/02/17 19:49:33 midas
|
Revision 1.257 2004/02/17 19:49:33 midas
|
||||||
Fixed problem with date attributes in conjunction with conditional attributes
|
Fixed problem with date attributes in conjunction with conditional attributes
|
||||||
|
|
||||||
@ -8644,12 +8647,16 @@ int retrieve_remote_md5(LOGBOOK * lbs, char *host, MD5_INDEX ** md5_index,
|
|||||||
}
|
}
|
||||||
p = strstr(text, "ELOG HTTP ");
|
p = strstr(text, "ELOG HTTP ");
|
||||||
if (!p) {
|
if (!p) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
sprintf(error_str, loc("Remote server is not an ELOG server"));
|
sprintf(error_str, loc("Remote server is not an ELOG server"));
|
||||||
free(text);
|
free(text);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
version = atoi(p + 10) * 100 + atoi(p + 12) * 10 + atoi(p + 14);
|
version = atoi(p + 10) * 100 + atoi(p + 12) * 10 + atoi(p + 14);
|
||||||
if (version < 250) {
|
if (version < 250) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
memset(str, 0, sizeof(str));
|
memset(str, 0, sizeof(str));
|
||||||
strncpy(str, p + 10, 5);
|
strncpy(str, p + 10, 5);
|
||||||
sprintf(error_str, loc("Incorrect remote ELOG server version %s"), str);
|
sprintf(error_str, loc("Incorrect remote ELOG server version %s"), str);
|
||||||
@ -8659,6 +8666,9 @@ int retrieve_remote_md5(LOGBOOK * lbs, char *host, MD5_INDEX ** md5_index,
|
|||||||
|
|
||||||
p = strstr(text, "Location: ");
|
p = strstr(text, "Location: ");
|
||||||
if (p) {
|
if (p) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
|
|
||||||
if (strstr(text, "?wusr="))
|
if (strstr(text, "?wusr="))
|
||||||
sprintf(error_str, loc("User \"%s\" has no access to remote logbook"),
|
sprintf(error_str, loc("User \"%s\" has no access to remote logbook"),
|
||||||
getparam("unm"));
|
getparam("unm"));
|
||||||
@ -8674,6 +8684,8 @@ int retrieve_remote_md5(LOGBOOK * lbs, char *host, MD5_INDEX ** md5_index,
|
|||||||
|
|
||||||
p = strstr(text, "\r\n\r\n");
|
p = strstr(text, "\r\n\r\n");
|
||||||
if (!p) {
|
if (!p) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
sprintf(error_str, loc("Invalid HTTP header"));
|
sprintf(error_str, loc("Invalid HTTP header"));
|
||||||
free(text);
|
free(text);
|
||||||
return -1;
|
return -1;
|
||||||
@ -8706,6 +8718,8 @@ int retrieve_remote_md5(LOGBOOK * lbs, char *host, MD5_INDEX ** md5_index,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
if (strstr(text, "Login"))
|
if (strstr(text, "Login"))
|
||||||
sprintf(error_str, loc("No user name supplied to access remote logbook"));
|
sprintf(error_str, loc("No user name supplied to access remote logbook"));
|
||||||
else
|
else
|
||||||
@ -9031,6 +9045,9 @@ int submit_message(LOGBOOK * lbs, char *host, int message_id, char *error_str)
|
|||||||
} else
|
} else
|
||||||
sprintf(error_str, "Error transmitting message\n");
|
sprintf(error_str, "Error transmitting message\n");
|
||||||
|
|
||||||
|
if (error_str[0] && isparam("debug"))
|
||||||
|
rsputs(text);
|
||||||
|
|
||||||
free(text);
|
free(text);
|
||||||
|
|
||||||
if (error_str[0])
|
if (error_str[0])
|
||||||
@ -9057,6 +9074,8 @@ int receive_message(LOGBOOK * lbs, char *url, int message_id, char *error_str, B
|
|||||||
retrieve_url(str, &message);
|
retrieve_url(str, &message);
|
||||||
p = strstr(message, "\r\n\r\n");
|
p = strstr(message, "\r\n\r\n");
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(message);
|
||||||
free(message);
|
free(message);
|
||||||
sprintf(error_str, loc("Cannot receive \"%s\""), str);
|
sprintf(error_str, loc("Cannot receive \"%s\""), str);
|
||||||
return -1;
|
return -1;
|
||||||
@ -9065,6 +9084,8 @@ int receive_message(LOGBOOK * lbs, char *url, int message_id, char *error_str, B
|
|||||||
|
|
||||||
/* check for correct ID */
|
/* check for correct ID */
|
||||||
if (atoi(p + 8) != message_id) {
|
if (atoi(p + 8) != message_id) {
|
||||||
|
if (isparam("debug"))
|
||||||
|
rsputs(message);
|
||||||
free(message);
|
free(message);
|
||||||
sprintf(error_str, loc("Received wrong entry id \"%d\""), atoi(p + 8));
|
sprintf(error_str, loc("Received wrong entry id \"%d\""), atoi(p + 8));
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user