icalcomponent *get_freebusy_for_user(char *who) {
long nLines;
char buf[SIZ];
- StrBuf *serialized_fb = NULL;
+ StrBuf *serialized_fb = NewStrBuf();
icalcomponent *fb = NULL;
serv_printf("ICAL freebusy|%s", who);
serv_getln(buf, sizeof buf);
if (buf[0] == '1') {
- serialized_fb = read_server_text(&nLines);
+ read_server_text(serialized_fb, &nLines);
}
if (serialized_fb == NULL) {
void do_freebusy(char *req) {
char who[SIZ];
char buf[SIZ];
- StrBuf *fb;
int len;
long lines;
return;
}
- fb = read_server_text(&lines);
- http_transmit_thing(fb, "text/calendar", 0);
- FreeStrBuf(&fb);
+ read_server_text(WC->WBuf, &lines);
+ http_transmit_thing("text/calendar", 0);
}
+webcit (7.37-36) stable; urgency=low
+
+ * fix tiny JS error anoying HTTP IM Users
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 16 Jul 2008 14:00:00 +0002
+
+webcit (7.37-35) stable; urgency=low
+
+ * tiny bugfix with i18n makefiles
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Sun, 22 Jun 2008 22:00:00 +0002
+
+webcit (7.37-34) stable; urgency=low
+
+ * new upstream version
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Thu, 19 Jun 2008 22:00:00 +0002
+
+webcit (7.36-33) stable; urgency=low
+
+ * new upstream version
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Fri, 30 May 2008 19:00:00 +0002
+
+webcit (7.35-32) stable; urgency=low
+
+ * fix prototype package integration
+ * updated brazillian translation
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 22 Apr 2008 8:00:00 +0001
+webcit (7.35-31) stable; urgency=low
+
+ * New citadel version
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 22 Apr 2008 19:00:00 +0002
+
+webcit (7.34-29) stable; urgency=high
+
+ * fix bug in addressbook popup
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 5 Mar 2008 22:00:00 +0001
+
+webcit (7.33-28) stable; urgency=high
+
+ * adjusted license; new sorting in lists
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Mo, 3 Mar 2008 22:00:00 +0001
+
+webcit (7.31-27) stable; urgency=high
+
+ * initial mime detection support
+ * don't nail the users to GIF
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Tue, 12 Feb 2008 0:00:00 +0001
+
+webcit (7.30-26) stable; urgency=high
+
+ * Fix room admin dialog
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Wed, 6 Feb 2008 20:00:00 +0001
+webcit (7.30-25) stable; urgency=high
+
+ * New citadel version.
+
+ -- Wilfried Goesgens <w.goesgens@outgesourced.org> Fri, 1 Feb 2008 10:00:00 +0001
webcit (7.24-24) stable; urgency=high
* fixed missing locales and image calculation
void download_file(void)
{
- StrBuf *Buf;
char buf[256];
off_t bytes;
char content_type[256];
extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
}
output_headers(0, 0, 0, 0, 0, 0);
- Buf = read_server_binary(bytes);
+ read_server_binary(WC->WBuf, bytes);
serv_puts("CLOS");
serv_getln(buf, sizeof buf);
- http_transmit_thing(Buf, content_type, 0);
+ http_transmit_thing(content_type, 0);
free(content);
} else {
hprintf("HTTP/1.1 404 %s\n", &buf[4]);
hprintf("Content-type: text/html\r\n"
"Server: %s\r\n"
- "Connection: close\r\n"
+ "Connection: close\r\n",
PACKAGE_STRING);
begin_burst();
* server READ commands.
* \return the read content as StrBuf
*/
-StrBuf *read_server_binary(size_t total_len)
+int read_server_binary(StrBuf *Ret, size_t total_len)
{
char buf[SIZ];
size_t bytes = 0;
size_t thisblock = 0;
StrBuf *Buf;
- StrBuf *Ret = NULL;
-
- Buf = NewStrBuf();
+ Buf = NewStrBuf();
+ if (Ret == NULL)
+ return -1;
+
while (bytes < total_len) {
thisblock = 4095;
if ((total_len - bytes) < thisblock) {
thisblock = total_len - bytes;
if (thisblock == 0) {
- FreeStrBuf(&Ret);
+ FlushStrBuf(Ret);
FreeStrBuf(&Buf);
- return NULL;
+ return -1;
}
}
serv_printf("READ %d|%d", (int)bytes, (int)thisblock);
StrBufCutLeft(Buf, 4); //thisblock = (size_t)atoi(&buf[4]);
thisblock = StrTol(Buf);
if (!WC->connected) {
- FreeStrBuf(&Ret);
+ FlushStrBuf(Ret);
FreeStrBuf(&Buf);
- return NULL;
+ return -1;
}
- if (Ret == NULL) Ret = NewStrBuf();
StrBuf_ServGetBLOB(Ret, thisblock);
bytes += thisblock;
}
else {
FreeStrBuf(&Buf);
lprintf(3, "Error: %s\n", &buf[4]);
- return NULL;
+ return -1;
}
}
}
- return Ret;
+ return StrLength(Ret);
}
* usual 000 terminator is found. Caller is responsible for freeing
* the returned pointer.
*/
-StrBuf *read_server_text(long *nLines)
+int read_server_text(StrBuf *Buf, long *nLines)
{
struct wcsession *WCC = WC;
- StrBuf *Buf;
long nRead;
+ long nTotal = 0;
long nlines;
- const char *buf;
- Buf = NewStrBuf();
- buf = ChrPtr(Buf);
nlines = 0;
while ((WCC->serv_sock!=-1) &&
- (nRead = StrBuf_ServGetln(Buf)),
- (nRead >= 0) &&
- (buf += nRead), (strcmp(buf, "000") != 0)) {
-
+ (nRead = StrBuf_ServGetln(Buf), (nRead >= 0) ))
+ {
+ if (strcmp(ChrPtr(Buf) + nTotal, "000") != 0) {
+ StrBufCutRight(Buf, nRead);
+ break;
+ }
+ nTotal += nRead;
nlines ++;
}
*nLines = nlines;
- return Buf;
+ return nTotal;
}
/*
* Output a piece of content to the web browser using conformant HTTP and MIME semantics
*/
-void http_transmit_thing(StrBuf *thing, const char *content_type,
+void http_transmit_thing(const char *content_type,
int is_static) {
output_headers(0, 0, 0, 0, 0, is_static);
content_type,
PACKAGE_STRING);
- WC->WBuf = thing;
end_burst();
- WC->WBuf = NULL;
}
/*
struct stat statbuf;
off_t bytes;
off_t count = 0;
- StrBuf *Buf;
const char *content_type;
int len;
const char *Err;
count = 0;
bytes = statbuf.st_size;
- Buf = NewStrBufPlain(NULL, bytes + 2);
- if (Buf == NULL) {
- lprintf(9, "output_static('%s') -- MALLOC FAILED (%s) --\n", what, strerror(errno));
- hprintf("HTTP/1.1 500 internal server error\r\n");
- hprintf("Content-Type: text/plain\r\n");
- end_burst();
- return;
- }
-/// StrBufAppendBuf(Buf, WC->WBuf, 0);
- if (StrBufReadBLOB(Buf, &fd, 1, bytes, &Err) < 0)
+
+ if (StrBufReadBLOB(WC->WBuf, &fd, 1, bytes, &Err) < 0)
{
+ if (fd > 0) close(fd);
lprintf(9, "output_static('%s') -- FREAD FAILED (%s) --\n", what, strerror(errno));
hprintf("HTTP/1.1 500 internal server error \r\n");
hprintf("Content-Type: text/plain\r\n");
close(fd);
lprintf(9, "output_static('%s') %s\n", what, content_type);
- http_transmit_thing(Buf, content_type, 1);
- FreeStrBuf(&Buf);
+ http_transmit_thing(content_type, 1);
}
if (yesbstr("force_close_session")) {
end_webcit_session();
*/
void output_image()
{
+ struct wcsession *WCC = WC;
char buf[SIZ];
char *xferbuf = NULL;
off_t bytes;
const char *MimeType;
- StrBuf *Buf;
-
+
serv_printf("OIMG %s|%s", bstr("name"), bstr("parm"));
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
/** Read it from the server */
- Buf = read_server_binary(bytes);
- serv_puts("CLOS");
- serv_getln(buf, sizeof buf);
-
- MimeType = GuessMimeType (ChrPtr(Buf), StrLength(Buf));
- /** Write it to the browser */
- if (!IsEmptyStr(MimeType))
- {
- http_transmit_thing(Buf,
- MimeType,
- 0);
- FreeStrBuf(&Buf);
- return;
+ if (read_server_binary(WCC->WBuf, bytes) > 0) {
+ serv_puts("CLOS");
+ serv_getln(buf, sizeof buf);
+
+ MimeType = GuessMimeType (ChrPtr(WCC->WBuf), StrLength(WCC->WBuf));
+ /** Write it to the browser */
+ if (!IsEmptyStr(MimeType))
+ {
+ http_transmit_thing(MimeType, 0);
+ return;
+ }
}
/* hm... unknown mimetype? fallback to blank gif */
}
long msgnum = 0L;
char *vcard;
struct vCard *v;
- char *xferbuf;
char *photosrc;
- int decoded;
const char *contentType;
- StrBuf *Buf;
+ struct wcsession *WCC = WC;
- msgnum = StrTol(WC->UrlFragment1);
+ msgnum = StrTol(WCC->UrlFragment1);
vcard = load_mimepart(msgnum,"1");
v = vcard_load(vcard);
photosrc = vcard_get_prop(v, "PHOTO", 1,0,0);
- xferbuf = malloc(strlen(photosrc));
- if (xferbuf == NULL) {
- lprintf(5, "xferbuf malloc failed\n");
+ FlushStrBuf(WCC->WBuf);
+ StrBufAppendBufPlain(WCC->WBuf, photosrc, -1, 0);
+ if (StrBufDecodeBase64(WCC->WBuf) <= 0) {
+ FlushStrBuf(WCC->WBuf);
+
+ hprintf("HTTP/1.1 500 %s\n","Unable to get photo");
+ output_headers(0, 0, 0, 0, 0, 0);
+ hprintf("Content-Type: text/plain\r\n");
+ wprintf(_("Could Not decode vcard photo\n"));
+ end_burst();
return;
}
- memset(xferbuf, 1, SIZ);
- decoded = CtdlDecodeBase64(
- xferbuf,
- photosrc,
- strlen(photosrc));
- contentType = GuessMimeType(xferbuf, decoded);
- Buf = _NewConstStrBuf(xferbuf, decoded);
- http_transmit_thing(Buf, contentType, 0);
+ contentType = GuessMimeType(ChrPtr(WCC->WBuf), StrLength(WCC->WBuf));
+ http_transmit_thing(contentType, 0);
free(v);
free(photosrc);
- free(xferbuf);
- FreeStrBuf(&Buf);
}
/*
serv_printf("OPNA %s|%s", msgnum, partnum);
serv_getln(buf, sizeof buf);
if (buf[0] == '2') {
- StrBuf *Buf;
bytes = extract_long(&buf[4], 0);
content = malloc(bytes + 2);
if (force_download) {
}
output_headers(0, 0, 0, 0, 0, 0);
- Buf = read_server_binary(bytes);
+ read_server_binary(WC->WBuf, bytes);
serv_puts("CLOS");
serv_getln(buf, sizeof buf);
- http_transmit_thing(Buf, content_type, 0);
- FreeStrBuf(&Buf);
+ http_transmit_thing(content_type, 0);
} else {
hprintf("HTTP/1.1 404 %s\n", &buf[4]);
output_headers(0, 0, 0, 0, 0, 0);
strcpy(browser_host, "");
WCC= WC;
+ if (WCC->WBuf == NULL)
+ WCC->WBuf = NewStrBuf();
+ FlushStrBuf(WCC->WBuf);
+
if (WCC->HBuf == NULL)
WCC->HBuf = NewStrBuf();
FlushStrBuf(WCC->HBuf);
+
WCC->upload_length = 0;
WCC->upload = NULL;
WCC->is_mobile = 0;
extern char *months[];
extern char *days[];
-StrBuf *read_server_binary(size_t total_len);
+int read_server_binary(StrBuf *Ret, size_t total_len);
int StrBuf_ServGetBLOB(StrBuf *buf, long BlobSize);
-StrBuf *read_server_text(long *nLines);
+int read_server_text(StrBuf *Buf, long *nLines);;
int goto_config_room(void);
long locate_user_vcard(char *username, long usernum);
void sleeeeeeeeeep(int);
-void http_transmit_thing(StrBuf *thing, const char *content_type, int is_static);
+void http_transmit_thing(const char *content_type, int is_static);
long unescape_input(char *buf);
void do_selected_iconbar(void);
int CtdlDecodeQuotedPrintable(char *decoded, char *encoded, int sourcelen);