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"
27 #include "../../../pith/osdep/collate.h"
35 rd_prompt_about_forged_remote_data(reason
, rd
, extra
)
41 char *unknown
= "<unknown>";
42 char *foldertype
, *foldername
, *special
;
45 * Since we're web based the user doesn't have much recourse in the event of one of these
46 * weird errors, so we just report what happened and forge ahead
49 foldertype
= (rd
&& rd
->t
.i
.special_hdr
&& !strucmp(rd
->t
.i
.special_hdr
, REMOTE_ABOOK_SUBTYPE
))
51 : (rd
&& rd
->t
.i
.special_hdr
&& !strucmp(rd
->t
.i
.special_hdr
, REMOTE_PINERC_SUBTYPE
))
54 foldername
= (rd
&& rd
->rn
) ? rd
->rn
: unknown
;
55 special
= (rd
&& rd
->t
.i
.special_hdr
) ? rd
->t
.i
.special_hdr
: unknown
;
57 dprint((1, "rd_check_out_forged_remote_data: reason: %d, type: $s, name: %s",
58 reason
, foldertype
? foldertype
: "?", foldername
? foldername
: "?"));
60 if(rd
&& rd
->flags
& USER_SAID_NO
)
64 snprintf(tmp
, sizeof(tmp
), _("Missing \"%s\" header in remote pinerc"), special
);
65 tmp
[sizeof(tmp
)-1] = '\0';
67 else if(reason
== -1){
68 snprintf(tmp
, sizeof(tmp
), _("Unexpected \"Received\" header in remote pinerc"));
69 tmp
[sizeof(tmp
)-1] = '\0';
72 snprintf(tmp
, sizeof(tmp
), _("Unexpected value \"%s: %s\" in remote pinerc"), special
, (extra
&& *extra
) ? extra
: "?");
73 tmp
[sizeof(tmp
)-1] = '\0';
76 rd
->flags
|= USER_SAID_YES
;