scannews now creates a debug file
This commit is contained in:
parent
2256134a74
commit
0c57e334fd
@ -314,17 +314,24 @@ int get_article(char *msgid, char *ftntag)
|
|||||||
{
|
{
|
||||||
char cmd[81], *resp;
|
char cmd[81], *resp;
|
||||||
int retval, done = FALSE;
|
int retval, done = FALSE;
|
||||||
FILE *fp = NULL;
|
FILE *fp = NULL, *dp;
|
||||||
|
char dpath[PATH_MAX];
|
||||||
|
|
||||||
Syslog('n', "Get article %s, %s", msgid, ftntag);
|
Syslog('n', "Get article %s, %s", msgid, ftntag);
|
||||||
if (!SearchMsgs(ftntag)) {
|
if (!SearchMsgs(ftntag)) {
|
||||||
WriteError("Search message area %s failed", ftntag);
|
WriteError("Search message area %s failed", ftntag);
|
||||||
return RETVAL_ERROR;
|
return RETVAL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprintf(dpath, "%s/tmp/scannews.last", getenv("MBSE_ROOT"));
|
||||||
|
dp = fopen(dpath, "w");
|
||||||
|
|
||||||
IsDoing("Article %d", (news_in + 1));
|
IsDoing("Article %d", (news_in + 1));
|
||||||
sprintf(cmd, "ARTICLE %s\r\n", msgid);
|
sprintf(cmd, "ARTICLE %s\r\n", msgid);
|
||||||
|
fprintf(dp, "ARTICLE %s\n", msgid);
|
||||||
nntp_send(cmd);
|
nntp_send(cmd);
|
||||||
resp = nntp_receive();
|
resp = nntp_receive();
|
||||||
|
fprintf(dp, "%s\n", resp);
|
||||||
retval = atoi(strtok(resp, " "));
|
retval = atoi(strtok(resp, " "));
|
||||||
switch (retval) {
|
switch (retval) {
|
||||||
case 412: WriteError("No newsgroup selected");
|
case 412: WriteError("No newsgroup selected");
|
||||||
@ -341,6 +348,8 @@ int get_article(char *msgid, char *ftntag)
|
|||||||
}
|
}
|
||||||
while (done == FALSE) {
|
while (done == FALSE) {
|
||||||
resp = nntp_receive();
|
resp = nntp_receive();
|
||||||
|
fprintf(dp, resp);
|
||||||
|
fprintf(dp, "\n");
|
||||||
if ((strlen(resp) == 1) && (strcmp(resp, ".") == 0)) {
|
if ((strlen(resp) == 1) && (strcmp(resp, ".") == 0)) {
|
||||||
done = TRUE;
|
done = TRUE;
|
||||||
} else {
|
} else {
|
||||||
@ -354,6 +363,7 @@ int get_article(char *msgid, char *ftntag)
|
|||||||
IsDoing("Article %d", (news_in));
|
IsDoing("Article %d", (news_in));
|
||||||
retval = rfc2ftn(fp, NULL);
|
retval = rfc2ftn(fp, NULL);
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
fclose(dp);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user