int haveChar = 0;
int haveNum = 0;
int haveOther = 0;
- int count = 0;
+ int haveLong = 0;
pch = buf;
while (!IsEmptyStr(pch))
{
haveOther = 1;
pch ++;
}
- count = pch - buf;
- if (count > 7)
- count = 0;
- switch (count){
+ if (pch - buf > 7)
+ haveLong = 1;
+ switch (haveLong +
+ haveChar +
+ haveNum +
+ haveOther)
+ {
case 0:
pch = _("very weak");
break;
wc_printf(_("Last"));
}
else {
- wc_printf("%d", i + 1); // change to one-based for display
+ wc_printf("%d", i + 1); /* change to one-based for display */
}
if (i == BBS->requested_page) {
wc_printf("]");
* which they point are still owned by the hash list.
*/
if (num_blogposts > 0) {
+ int start_here = 0;
/* Sort newest-to-oldest */
qsort(blogposts, num_blogposts, sizeof(void *), blogview_sortfunc);
/* allow the user to select a starting point in the list */
- int start_here = 0;
for (i=0; i<num_blogposts; ++i) {
if (blogposts[i]->top_level_id == firstp) {
start_here = i;
char mime_filename[256];
char mime_content_type[256];
char mime_disposition[256];
- int mime_length;
char relevant_partnum[256];
char *relevant_source = NULL;
int phase = 0; /* 0 = citadel headers, 1 = mime headers, 2 = body */
extract_token(mime_partnum, &bptr[5], 2, '|', sizeof mime_partnum);
extract_token(mime_disposition, &bptr[5], 3, '|', sizeof mime_disposition);
extract_token(mime_content_type, &bptr[5], 4, '|', sizeof mime_content_type);
- mime_length = extract_int(&bptr[5], 5);
+ /* do we care? mime_length = */extract_int(&bptr[5], 5);
if ( (!strcasecmp(mime_content_type, "text/calendar"))
|| (!strcasecmp(mime_content_type, "application/ics"))
int i;
time_t now;
struct tm tm_now;
- int this_year;
time_t tt;
struct tm tm;
int all_day_event = 0;
now = time(NULL);
localtime_r(&now, &tm_now);
- this_year = tm_now.tm_year + 1900;
if (t == NULL) return;
if (t->is_date) all_day_event = 1;
icalproperty *e;
struct icaltimetype t;
disp_cal *Cal;
- int month, day, year;
int all_day_event = 0;
char *timeformat;
int time_format;
else timeformat="%I:%M %p";
localtime_r(&thetime, &today_tm);
- month = today_tm.tm_mon + 1;
- day = today_tm.tm_mday;
- year = today_tm.tm_year + 1900;
Pos = GetNewHashPos(WCC->disp_cal_items, 0);
while (GetNextHashPos(WCC->disp_cal_items, Pos, &hklen, &HashKey, &vCal)) {
wc_printf("<dt class=\"extrahour\">"
"<a href=\"display_edit_event?msgnum=0"
"?calview=day?year=%d?month=%d?day=%d?hour=%d?minute=0\">",
+/* TODO: what have these been used for?
(hour * extratimeline ),
extratimeline,
extrahourlabel,
+*/
year, month, day, hour
);
wc_printf("<dt class=\"hour\">"
"<a href=\"display_edit_event?msgnum=0?calview=day"
"?year=%d?month=%d?day=%d?hour=%d?minute=0\">",
+/*TODO: what have these been used for?
gap + ((hour - daystart) * timeline ),
timeline,
hourlabel,
+*/
year, month, day, hour
);
wc_printf("<dt class=\"extrahour\">"
"<a href=\"display_edit_event?msgnum=0?calview=day"
"?year=%d?month=%d?day=%d?hour=%d?minute=0\">",
+/*TODO: what have these been used for?
gap + ((hour - dayend - 1) * extratimeline ),
extratimeline,
extrahourlabel,
+*/
year, month, day, hour
);
*/
void init_ssl(void)
{
- SSL_METHOD *ssl_method;
+ const SSL_METHOD *ssl_method;
RSA *rsa=NULL;
X509_REQ *req = NULL;
X509 *cer = NULL;
* starts SSL/TLS encryption for the current session.
*/
int starttls(int sock) {
- int retval, bits, alg_bits, r;
+ int retval, bits, alg_bits;/*r; */
SSL *newssl;
pthread_setspecific(ThreadSSL, NULL);
else {
syslog(15, "SSL_accept success\n");
}
- r = BIO_set_close(newssl->rbio, BIO_NOCLOSE);
+ /*r = */BIO_set_close(newssl->rbio, BIO_NOCLOSE);
bits = SSL_CIPHER_get_bits(SSL_get_current_cipher(newssl), &alg_bits);
syslog(15, "SSL/TLS using %s on %s (%d of %d bits)\n",
SSL_CIPHER_get_name(SSL_get_current_cipher(newssl)),
*/
void endtls(void)
{
- SSL_CTX *ctx = NULL;
+ /*SSL_CTX *ctx;*/
if (THREADSSL == NULL) return;
syslog(15, "Ending SSL/TLS\n");
SSL_shutdown(THREADSSL);
- ctx = SSL_get_SSL_CTX(THREADSSL);
+ /*ctx = */SSL_get_SSL_CTX(THREADSSL);
/* I don't think this is needed, and it crashes the server anyway
*
int sequence = 0;
char buf[1024];
CompareFunc SortIt;
- int HavePic;
+ int HavePic = 0;
WCTemplputParams SubTP;
memset(&SubTP, 0, sizeof(WCTemplputParams));
}
Put(Files, SKEY(Entry->Filename), Entry, FreeFiles);
}
+ if (HavePic)
+ putbstr("__HAVE_PIC", NewStrBufPlain(HKEY("1")));
SubTP.Filter.ContextType = CTX_FILELIST;
SortIt = RetrieveSort(&SubTP, NULL, 0, HKEY("fileunsorted"), 0);
if (SortIt != NULL)
char buf[SIZ];
int organizer_is_me = 0;
int i, j = 0;
+ /************************************************************
+ * Uncomment this to see the UID in calendar events for debugging
int sequence = 0;
+ */
char weekday_labels[7][32];
char month_labels[12][32];
long weekstart = 0;
/* Learn the sequence */
p = icalcomponent_get_first_property(vevent, ICAL_SEQUENCE_PROPERTY);
+ /************************************************************
+ * Uncomment this to see the UID in calendar events for debugging
if (p != NULL) {
sequence = icalproperty_get_sequence(p);
}
-
+ */
/* Begin output */
output_headers(1, 1, 2, 0, 0, 0);
wc_printf("<div id=\"banner\">\n");
int i;
char buf[32];
char *language = NULL;
- char *locale;
-
nLocales = 0;
while (!IsEmptyStr(AvailLang[nLocales]))
}
#ifdef ENABLE_NLS
- locale = setlocale(LC_ALL, "");
+ /*locale = */setlocale(LC_ALL, "");
syslog(9, "Message catalog directory: %s\n", bindtextdomain("webcit", LOCALEDIR"/locale"));
syslog(9, "Text domain: %s\n", textdomain("webcit"));
long dav_msgnum = (-1);
char buf[1024];
int in_body = 0;
- int found_content_type = 0;
char *ptr;
char *endptr;
char *msgtext = NULL;
/* We got it; a message is now arriving from the server. Read it in. */
in_body = 0;
- found_content_type = 0;
strcpy(charset, "UTF-8");
strcpy(content_type, "text/plain");
strcpy(date, "");
InitModule_GROUPDAV
(void)
{
-// WebcitAddUrlHandler(HKEY("groupdav"), "", 0, groupdav_main, XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+/*
+ WebcitAddUrlHandler(HKEY("groupdav"), "", 0, groupdav_main, XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+ */
RegisterDAVNamespace(HKEY("groupdav"), HKEY("GroupDAV"),
groupdav_main, GroupdavDispatchREST,
XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
char *pop_march(int desired_floor)
{
static char TheRoom[128];
- int TheFloor = 0;
- int TheOrder = 32767;
int TheWeight = 0;
int weight;
struct march *mptr = NULL;
if (weight > TheWeight) {
TheWeight = weight;
strcpy(TheRoom, mptr->march_name);
+/* TODOO: and now????
TheFloor = mptr->march_floor;
TheOrder = mptr->march_order;
+*/
}
}
return (TheRoom);
#include "webcit.h"
#include "webserver.h"
#include "groupdav.h"
+#include "calendar.h"
HashList *MsgHeaderHandler = NULL;
HashList *MsgEvaluators = NULL;
}
-void
+long
HttpStatus(long CitadelStatus)
{
long httpstatus = 502;
break;
}
-
+ return httpstatus;
}
/*
GetHash(ReadLoopHandler, IKEY(WCC->CurRoom.view), &vViewMsg);
}
if (vViewMsg == NULL) {
- return; // TODO: print message
+ return; /* TODO: print message */
}
ViewMsg = (RoomRenderer*) vViewMsg;
void display_enter(void)
{
char buf[SIZ];
- long now;
const StrBuf *display_name = NULL;
int recipient_required = 0;
int subject_required = 0;
int is_anonymous = 0;
wcsession *WCC = WC;
int i = 0;
-
- now = time(NULL);
+ long replying_to;
if (havebstr("force_room")) {
gotoroom(sbstr("force_room"));
* If the "replying_to" variable is set, it refers to a message
* number from which we must extract some header fields...
*/
- long replying_to = lbstr("replying_to");
+ replying_to = lbstr("replying_to");
if (replying_to > 0) {
char wefw[1024] = "";
char msgn[256] = "";
}
else if (!strncasecmp(buf, "wefw=", 5)) {
+ int rrtok;
+ int rrlen;
safestrncpy(wefw, &buf[5], sizeof wefw);
/* Trim down excessively long lists of thread references. We eliminate the
* second one in the list so that the thread root remains intact.
*/
- int rrtok = num_tokens(wefw, '|');
- int rrlen = strlen(wefw);
+ rrtok = num_tokens(wefw, '|');
+ rrlen = strlen(wefw);
if ( ((rrtok >= 3) && (rrlen > 900)) || (rrtok > 10) ) {
remove_token(wefw, 1, '|');
}
if (havebstr("recp") &&
havebstr("cc" ) &&
havebstr("bcc" )) {
- recipient_bad = 1;
+ recipient_bad = 1; /* TODO: and now????? */
}
}
else if (buf[0] != '2') { /* Any other error means that we cannot continue */
*/
void confirm_move_msg(void)
{
- long msgid;
char buf[SIZ];
char targ[SIZ];
- msgid = lbstr("msgid");
-
-
output_headers(1, 1, 2, 0, 0, 0);
wc_printf("<div id=\"banner\">\n");
wc_printf("<h1>");
RegisterReadLoopHandlerset(
VIEW_MAILBOX,
mailview_GetParamsGetServerCall,
- NULL, /// TODO: is this right?
+ NULL, /* TODO: is this right? */
ParseMessageListHeaders_Detail,
- NULL, //// ""
+ NULL,
mailview_RenderView_or_Tail,
mailview_Cleanup);
HashList *Hash;
char nnn[64];
char buf[SIZ];
- long len;
int nUsed;
+ long len;
NodeConf *Node;
serv_puts("CONF getsys|application/x-citadel-ignet-config");
Buf = NewStrBuf();
while ((len = StrBuf_ServGetln(Buf),
- strcmp(ChrPtr(Buf), "000"))) {
+ (len != 3) || !strcmp(ChrPtr(Buf), "000"))) {
Node = NewNode(Buf);
if (Node == NULL)
continue;
char mime_filename[256];
char mime_content_type[256];
char mime_disposition[256];
- int mime_length;
char relevant_partnum[256];
int phase = 0; /* 0 = citadel headers, 1 = mime headers, 2 = body */
char msg4_content_type[256] = "";
extract_token(mime_partnum, &bptr[5], 2, '|', sizeof mime_partnum);
extract_token(mime_disposition, &bptr[5], 3, '|', sizeof mime_disposition);
extract_token(mime_content_type, &bptr[5], 4, '|', sizeof mime_content_type);
- mime_length = extract_int(&bptr[5], 5);
if (!strcasecmp(mime_content_type, "text/vnote")) {
strcpy(relevant_partnum, mime_partnum);
*
* msgnum = Message number on the local server of the note to be displayed
*/
-////TODO: falscher hook
+/*TODO: wrong hook */
int notes_LoadMsgFromServer(SharedMessageStatus *Stat,
void **ViewSpecific,
message_summary* Msg,
void tmpl_vcard_put_message(StrBuf *Target, WCTemplputParams *TP)
{
struct vnote *v = (struct vnote *) CTX;
- StrEscAppend(Target, NULL, v->body, 0, 0); ///TODO?
+ StrEscAppend(Target, NULL, v->body, 0, 0); /*TODO?*/
}
void tmpl_vcard_put_uid(StrBuf *Target, WCTemplputParams *TP)
urlp = GetCount(WCC->Directory);
delta = Folder->nRoomNameParts - urlp + 1;
- syslog(0, "\n->%s: %ld - %ld ", ChrPtr(Folder->name), urlp,
- Folder->nRoomNameParts);
+ syslog(0, "\n->%s: %d - %ld ",
+ ChrPtr(Folder->name),
+ urlp,
+ Folder->nRoomNameParts);
/* list only the floors which are in relation to the dav_depth header */
if (WCC->Hdr->HR.dav_depth != delta) {
syslog(0, "1\n");
memset(room, 0, sizeof(folder));
room->name = pBuf;
- StrBufExtract_NextToken(room->name, Line, &Pos, '|'); // WC->CurRoom->name
+ StrBufExtract_NextToken(room->name, Line, &Pos, '|');
room->nNewMessages = StrBufExtractNext_long(Line, &Pos, '|');
if (room->nNewMessages > 0)
room->ShowInfo = StrBufExtractNext_long(Line, &Pos, '|');
- room->QRFlags = StrBufExtractNext_long(Line, &Pos, '|'); //CurRoom->QRFlags
+ room->QRFlags = StrBufExtractNext_long(Line, &Pos, '|');
DBG_QR(room->QRFlags);
room->HighestRead = StrBufExtractNext_long(Line, &Pos, '|');
room->LastMessageRead = StrBufExtractNext_long(Line, &Pos, '|');
- room->is_inbox = StrBufExtractNext_long(Line, &Pos, '|'); // is_mailbox
+ room->is_inbox = StrBufExtractNext_long(Line, &Pos, '|');
flag = StrBufExtractNext_long(Line, &Pos, '|');
if (WCC->is_aide || flag) {
room->UsersNewMAilboxMessages = StrBufExtractNext_long(Line, &Pos, '|');
- room->floorid = StrBufExtractNext_int(Line, &Pos, '|'); // wc_floor
+ room->floorid = StrBufExtractNext_int(Line, &Pos, '|');
- room->view = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->view
+ room->view = StrBufExtractNext_long(Line, &Pos, '|');
- room->defview = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->defview
+ room->defview = StrBufExtractNext_long(Line, &Pos, '|');
flag = StrBufExtractNext_long(Line, &Pos, '|');
if (flag)
- room->RAFlags |= UA_ISTRASH; // wc_is_trash
+ room->RAFlags |= UA_ISTRASH;
- room->QRFlags2 = StrBufExtractNext_long(Line, &Pos, '|'); // CurRoom->QRFlags2
+ room->QRFlags2 = StrBufExtractNext_long(Line, &Pos, '|');
DBG_QR2(room->QRFlags2);
/* find out, whether we are in a sub-room */
* Read Citadel variformat text and spit it out as HTML.
* align html align string
*/
-inline void fmout(char *align)
+inline void fmout(const char *align)
{
_fmout(WC->WBuf, align);
}
-void _fmout(StrBuf *Target, char *align)
+void _fmout(StrBuf *Target, const char *align)
{
int intext = 0;
int bq = 0;
wc_printf("</div><br>\n");
}
-void FmOut(StrBuf *Target, char *align, StrBuf *Source)
+void FmOut(StrBuf *Target, const char *align, StrBuf *Source)
{
const char *ptr, *pte;
const char *BufPtr = NULL;
#include "webcit.h"
#include "webserver.h"
+unsigned char OnePixelGif[37] = {
+ 0x47,
+ 0x49,
+ 0x46,
+ 0x38,
+ 0x37,
+ 0x61,
+ 0x01,
+ 0x00,
+ 0x01,
+ 0x00,
+ 0x80,
+ 0x00,
+ 0x00,
+ 0xff,
+ 0xff,
+ 0xff,
+ 0xff,
+ 0xff,
+ 0xff,
+ 0x2c,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x00,
+ 0x01,
+ 0x00,
+ 0x01,
+ 0x00,
+ 0x00,
+ 0x02,
+ 0x02,
+ 0x44,
+ 0x01,
+ 0x00,
+ 0x3b
+};
+
HashList *StaticFilemappings[4] = {NULL, NULL, NULL, NULL};
/*
- {
- syslog(9, "Suspicious request. Ignoring.");
- hprintf("HTTP/1.1 404 Security check failed\r\n");
- hprintf("Content-Type: text/plain\r\n\r\n");
- wc_printf("You have sent a malformed or invalid request.\r\n");
- end_burst();
- }
+ {
+ syslog(9, "Suspicious request. Ignoring.");
+ hprintf("HTTP/1.1 404 Security check failed\r\n");
+ hprintf("Content-Type: text/plain\r\n\r\n");
+ wc_printf("You have sent a malformed or invalid request.\r\n");
+ end_burst();
+ }
*/
+
+
+void output_error_pic(const char *ErrMsg1, const char *ErrMsg2)
+{
+ hprintf("HTTP/1.1 200 %s\r\n", ErrMsg1);
+ hprintf("Content-Type: image/gif\r\n");
+ hprintf("x-webcit-errormessage: %s\r\n", ErrMsg2);
+ begin_burst();
+ StrBufPlain(WC->WBuf, (const char *)OnePixelGif, sizeof(OnePixelGif));
+ end_burst();
+}
+
/*
* dump out static pages from disk
*/
int fd;
struct stat statbuf;
off_t bytes;
- off_t count = 0;
const char *content_type;
int len;
const char *Err;
+ len = strlen (what);
+ content_type = GuessMimeByFilename(what, len);
fd = open(what, O_RDONLY);
if (fd <= 0) {
syslog(9, "output_static('%s') [%s] -- NOT FOUND --\n", what, ChrPtr(WC->Hdr->this_page));
- hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
- hprintf("Content-Type: text/plain\r\n");
- begin_burst();
- wc_printf("Cannot open %s: %s\r\n", what, strerror(errno));
- end_burst();
- } else {
- len = strlen (what);
- content_type = GuessMimeByFilename(what, len);
-
- if (fstat(fd, &statbuf) == -1) {
- syslog(9, "output_static('%s') -- FSTAT FAILED --\n", what);
+ if (strstr(content_type, "image/") != NULL)
+ {
+ output_error_pic("the file you requsted is gone.", strerror(errno));
+ }
+ else
+ {
hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
hprintf("Content-Type: text/plain\r\n");
begin_burst();
- wc_printf("Cannot fstat %s: %s\n", what, strerror(errno));
+ wc_printf("Cannot open %s: %s\r\n", what, strerror(errno));
end_burst();
+ }
+ } else {
+ if (fstat(fd, &statbuf) == -1) {
+ syslog(9, "output_static('%s') -- FSTAT FAILED --\n", what);
+ if (strstr(content_type, "image/") != NULL)
+ {
+ output_error_pic("Stat failed!", strerror(errno));
+ }
+ else
+ {
+ hprintf("HTTP/1.1 404 %s\r\n", strerror(errno));
+ hprintf("Content-Type: text/plain\r\n");
+ begin_burst();
+ wc_printf("Cannot fstat %s: %s\n", what, strerror(errno));
+ end_burst();
+ }
if (fd > 0) close(fd);
return;
}
- count = 0;
bytes = statbuf.st_size;
if (StrBufReadBLOB(WC->WBuf, &fd, 1, bytes, &Err) < 0)
struct dirent *filedir_entry;
int d_type = 0;
int d_namelen;
- int d_without_ext;
int istoplevel;
filedir = opendir (DirName);
while ((readdir_r(filedir, d, &filedir_entry) == 0) &&
(filedir_entry != NULL))
{
- char *PStart;
#ifdef _DIRENT_HAVE_D_NAMELEN
d_namelen = filedir_entry->d_namelen;
d_type = filedir_entry->d_type;
d_namelen = strlen(filedir_entry->d_name);
d_type = DT_UNKNOWN;
#endif
- d_without_ext = d_namelen;
-
if ((d_namelen > 1) && filedir_entry->d_name[d_namelen - 1] == '~')
continue; /* Ignore backup files... */
break;
case DT_LNK: /* TODO: check whether its a file or a directory */
case DT_REG:
- PStart = filedir_entry->d_name;
FileName = NewStrBufDup(Dir);
if (ChrPtr(FileName) [ StrLength(FileName) - 1] != '/')
StrBufAppendBufPlain(FileName, "/", 1, 0);
(vFile != NULL))
{
File = (StrBuf*) vFile;
- output_static(ChrPtr(vFile));
+ output_static(ChrPtr(File));
}
}
wcsession *WCC = WC;
void *vFile;
StrBuf *File;
+ const char *MimeType;
if (GetHash(DirList, SKEY(WCC->Hdr->HR.ReqLine), &vFile) &&
(vFile != NULL))
{
File = (StrBuf*) vFile;
- output_static(ChrPtr(vFile));
+ output_static(ChrPtr(File));
}
else {
syslog(1, "output_static_safe() file %s not found. \n",
ChrPtr(WCC->Hdr->HR.ReqLine));
-///TODO: detect image & output blank image
- do_404();
+ MimeType = GuessMimeByFilename(SKEY(WCC->Hdr->HR.ReqLine));
+ if (strstr(MimeType, "image/") != NULL)
+ {
+ output_error_pic("the file you requested isn't known to our cache", "maybe reload webcit?");
+ }
+ else
+ {
+ do_404();
+ }
}
}
void output_static_0(void)
free(FreeMe);
}
-
-
-/**
- * \brief back end for print_value_of() ... does a server command
- * \param servcmd server command to execute on the citadel server
- */
-void pvo_do_cmd(StrBuf *Target, StrBuf *servcmd) {
- char buf[SIZ];
- int len;
-
- serv_puts(ChrPtr(servcmd));
- len = serv_getln(buf, sizeof buf);
-
- switch(buf[0]) {
- case '2':
- case '3':
- case '5':
- StrBufAppendPrintf(Target, "%s\n", &buf[4]);
- break;
- case '1':
- _fmout(Target, "CENTER");
- break;
- case '4':
- StrBufAppendPrintf(Target, "%s\n", &buf[4]);
- serv_puts("000");
- break;
- }
-}
-
int HaveTemplateTokenString(StrBuf *Target,
WCTemplputParams *TP,
int N,
WCTemplputParams *TP,
const StrBuf *Source, int FormatTypeIndex)
{
- wcsession *WCC;
const char *pFmt = NULL;
char EscapeAs = ' ';
switch(EscapeAs)
{
case 'H':
- WCC = WC;
StrEscAppend(Target, Source, NULL, 0, 2);
break;
case 'X':
struct stat statbuf;
const char *pS, *pE, *pch, *Err;
long Line;
- int pos;
fd = open(ChrPtr(NewTemplate->FileName), O_RDONLY);
if (fd <= 0) {
close(fd);
syslog(1, "ERROR: reading template '%s' - %s<br>\n",
ChrPtr(NewTemplate->FileName), strerror(errno));
- //FreeWCTemplate(NewTemplate);/////tODO
return NULL;
}
close(fd);
void *pv;
/** Find one <? > */
- pos = (-1);
for (; pch < pE; pch ++) {
if ((*pch=='<')&&(*(pch + 1)=='?') &&
!((pch == pS) && /* we must ommit a <?xml */
(filedir_entry != NULL))
{
char *MinorPtr;
- char *PStart;
+
#ifdef _DIRENT_HAVE_D_NAMELEN
d_namelen = filedir_entry->d_namelen;
d_type = filedir_entry->d_type;
(strcmp(&filedir_entry->d_name[d_without_ext], ".orig") == 0) ||
(strcmp(&filedir_entry->d_name[d_without_ext], ".swp") == 0))
continue; /* Ignore backup files... */
- PStart = filedir_entry->d_name;
StrBufPrintf(FileName, "%s/%s", ChrPtr(DirName), filedir_entry->d_name);
MinorPtr = strchr(filedir_entry->d_name, '.');
if (MinorPtr != NULL)
const char *OtherPrefix, long OtherPrefixLen,
const char *Default, long ldefault, long DefaultDirection)
{
- int isdefault = 0;
const StrBuf *BSort = NULL;
SortStruct *SortBy;
void *vSortBy;
if (!GetHash(SortHash, SKEY(BSort), &vSortBy) ||
(vSortBy == NULL)) {
- isdefault = 1;
if (!GetHash(SortHash, Default, ldefault, &vSortBy) ||
(vSortBy == NULL)) {
LogTemplateError(
icalcomponent *vtodo;
icalproperty *p;
struct icaltimetype IcalTime;
- time_t now;
int created_new_vtodo = 0;
icalproperty_status todoStatus;
- now = time(NULL);
-
if (supplied_vtodo != NULL) {
vtodo = supplied_vtodo;
StrBuf *Swap = NULL;
int i, j;
char buf[SIZ];
- char *name;
int is_qp = 0;
int is_b64 = 0;
StrBuf *thisname = NULL;
- char *thisvalue = NULL;
char firsttoken[SIZ];
- int pass;
- long len;
void *V;
Swap = NewStrBuf ();
thisname = NewStrBuf();
for (i=0; i<(v->numprops); ++i) {
- int len;
is_qp = 0;
is_b64 = 0;
StrBufPlain(thisname, v->prop[i].name, -1);
StrBufLowerCase(thisname);
- len = extract_token(firsttoken, thisname, 0, ';', sizeof firsttoken);
+ /*len = */extract_token(firsttoken, ChrPtr(thisname), 0, ';', sizeof firsttoken);
- for (j=0; j<num_tokens(thisname, ';'); ++j) {
- extract_token(buf, thisname, j, ';', sizeof buf);
+ for (j=0; j<num_tokens(ChrPtr(thisname), ';'); ++j) {
+ extract_token(buf, ChrPtr(thisname), j, ';', sizeof buf);
if (!strcasecmp(buf, "encoding=quoted-printable")) {
is_qp = 1;
- remove_token(thisname, j, ';');
+/* remove_token(thisname, j, ';');*/
}
if (!strcasecmp(buf, "encoding=base64")) {
is_b64 = 1;
- remove_token(thisname, j, ';');
+/* remove_token(thisname, j, ';');*/
}
}
{
eVC evc = (eVC) V;
Put(VC, IKEY(evc), Val, HFreeStrBuf);
- syslog(1, "[%ld]\n", evc);
+ syslog(1, "[%ul]\n", evc);
Val = NULL;
}
else
*/
void session_loop(void)
{
- int Flags = 0;
int xhttp;
StrBuf *Buf;
WCC->upload_length = 0;
WCC->upload = NULL;
WCC->Hdr->nWildfireHeaders = 0;
- if (WCC->Hdr->HR.Handler != NULL)
- Flags = WCC->Hdr->HR.Handler->Flags; /* so we can temporarily add our own... */
if (WCC->Hdr->HR.ContentLength > 0) {
if (ReadPostData() < 0) {
void pop_destination(void);
-void fmout(char *align);
-void _fmout(StrBuf *Targt, char *align);
-void FmOut(StrBuf *Target, char *align, StrBuf *Source);
+void fmout(const char *align);
+void _fmout(StrBuf *Targt, const char *align);
+void FmOut(StrBuf *Target, const char *align, const StrBuf *Source);
void wDumpContent(int);
extern char static_icon_dir[PATH_MAX]; /* where should we find our mime icons */
int is_https = 0; /* Nonzero if I am an HTTPS service */
int follow_xff = 0; /* Follow X-Forwarded-For: header */
-int home_specified = 0; /* did the user specify a homedir? */
int DisableGzip = 0;
struct redirector *redir = NULL;
char *default_landing_page = NULL;
char ip_addr[256]="*";
int relh=0;
int home=0;
- int home_specified=0;
char relhome[PATH_MAX]="";
char webcitdir[PATH_MAX] = DATADIR;
char *pidfile = NULL;
safestrncpy(relhome, relhome, sizeof relhome);
}
/* free(hdir); TODO: SHOULD WE DO THIS? */
- home_specified = 1;
home=1;
break;
case 'd':