1
#if !defined(lint) && !defined(DOS)
2
static char rcsid[] = "$Id: remote.c 101 2006-08-10 22:53:04Z mikes@u.washington.edu $";
5
/* ========================================================================
6
* Copyright 2006-2007 University of Washington
8
* Licensed under the Apache License, Version 2.0 (the "License");
9
* you may not use this file except in compliance with the License.
10
* You may obtain a copy of the License at
12
* http://www.apache.org/licenses/LICENSE-2.0
14
* ========================================================================
20
#include "../../../c-client/c-client.h"
22
#include "../../../pith/remote.h"
23
#include "../../../pith/msgno.h"
24
#include "../../../pith/filter.h"
25
#include "../../../pith/util.h"
26
#include "../../../pith/debug.h"
34
rd_prompt_about_forged_remote_data(reason, rd, extra)
40
char *unknown = "<unknown>";
41
char *foldertype, *foldername, *special;
44
* Since we're web based the user doesn't have much recourse in the event of one of these
45
* weird errors, so we just report what happened and forge ahead
48
foldertype = (rd && rd->t.i.special_hdr && !strucmp(rd->t.i.special_hdr, REMOTE_ABOOK_SUBTYPE))
50
: (rd && rd->t.i.special_hdr && !strucmp(rd->t.i.special_hdr, REMOTE_PINERC_SUBTYPE))
53
foldername = (rd && rd->rn) ? rd->rn : unknown;
54
special = (rd && rd->t.i.special_hdr) ? rd->t.i.special_hdr : unknown;
56
dprint((1, "rd_check_out_forged_remote_data: reason: %d, type: $s, name: %s",
57
reason, foldertype ? foldertype : "?", foldername ? foldername : "?"));
59
if(rd && rd->flags & USER_SAID_NO)
63
snprintf(tmp, sizeof(tmp), _("Missing \"%s\" header in remote pinerc"), special);
64
tmp[sizeof(tmp)-1] = '\0';
66
else if(reason == -1){
67
snprintf(tmp, sizeof(tmp), _("Unexpected \"Received\" header in remote pinerc"));
68
tmp[sizeof(tmp)-1] = '\0';
71
snprintf(tmp, sizeof(tmp), _("Unexpected value \"%s: %s\" in remote pinerc"), special, (extra && *extra) ? extra : "?");
72
tmp[sizeof(tmp)-1] = '\0';
75
rd->flags |= USER_SAID_YES;