1 /* ========================================================================
2 * Copyright 2006-2007 University of Washington
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * ========================================================================
16 #include "../../../c-client/c-client.h"
18 #include "../../../pith/remote.h"
19 #include "../../../pith/msgno.h"
20 #include "../../../pith/filter.h"
21 #include "../../../pith/util.h"
22 #include "../../../pith/debug.h"
23 #include "../../../pith/osdep/collate.h"
31 rd_prompt_about_forged_remote_data(int reason
, REMDATA_S
*rd
, char *extra
)
34 char *unknown
= "<unknown>";
35 char *foldertype
, *foldername
, *special
;
38 * Since we're web based the user doesn't have much recourse in the event of one of these
39 * weird errors, so we just report what happened and forge ahead
42 foldertype
= (rd
&& rd
->t
.i
.special_hdr
&& !strucmp(rd
->t
.i
.special_hdr
, REMOTE_ABOOK_SUBTYPE
))
44 : (rd
&& rd
->t
.i
.special_hdr
&& !strucmp(rd
->t
.i
.special_hdr
, REMOTE_PINERC_SUBTYPE
))
47 foldername
= (rd
&& rd
->rn
) ? rd
->rn
: unknown
;
48 special
= (rd
&& rd
->t
.i
.special_hdr
) ? rd
->t
.i
.special_hdr
: unknown
;
50 dprint((1, "rd_check_out_forged_remote_data: reason: %d, type: $s, name: %s",
51 reason
, foldertype
? foldertype
: "?", foldername
? foldername
: "?"));
53 if(rd
&& rd
->flags
& USER_SAID_NO
)
57 snprintf(tmp
, sizeof(tmp
), _("Missing \"%s\" header in remote pinerc"), special
);
58 tmp
[sizeof(tmp
)-1] = '\0';
60 else if(reason
== -1){
61 snprintf(tmp
, sizeof(tmp
), _("Unexpected \"Received\" header in remote pinerc"));
62 tmp
[sizeof(tmp
)-1] = '\0';
65 snprintf(tmp
, sizeof(tmp
), _("Unexpected value \"%s: %s\" in remote pinerc"), special
, (extra
&& *extra
) ? extra
: "?");
66 tmp
[sizeof(tmp
)-1] = '\0';
69 rd
->flags
|= USER_SAID_YES
;