From: Wilfried Göesgens Date: Sat, 25 Apr 2009 21:56:29 +0000 (+0000) Subject: * buybuy serv_read X-Git-Tag: v7.86~1216 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=fd6cb67fad06da34b1a7655f43e110a841963c5b * buybuy serv_read * fix some warnings --- diff --git a/webcit/graphics.c b/webcit/graphics.c index b62dd374a..6aab9381a 100644 --- a/webcit/graphics.c +++ b/webcit/graphics.c @@ -22,7 +22,7 @@ void display_graphics_upload(char *description, char *filename, char *uplurl) display_main_menu(); return; } - //output_headers(1, 1, 0, 0, 0, 0); + /*output_headers(1, 1, 0, 0, 0, 0); */ output_headers(1, 1, 1, 0, 0, 0); diff --git a/webcit/html2html.c b/webcit/html2html.c index 2e19e58e9..dea5647c7 100644 --- a/webcit/html2html.c +++ b/webcit/html2html.c @@ -397,8 +397,9 @@ void output_html(const char *supplied_charset, int treat_as_wiki, int msgnum, St } /** Fixup '); - + char* src; /* FIXME - handle this situation (maybe someone opened an Command:"); - escputs(bstr("g_cmd")); + StrEscAppend(WCC->WBuf, sbstr("g_cmd"), NULL, 0, 0); wprintf("Result:"); - escputs(buf); + StrEscAppend(WCC->WBuf, Buf, NULL, 0, 0); + StrBufAppendBufPlain(WCC->WBuf, HKEY("
\n"), 0); wprintf("

\n"); - - if (buf[0] == '8') { - serv_printf("\n\n000"); - } - if ((buf[0] == '1') || (buf[0] == '8')) { - while (serv_getln(gcontent, sizeof gcontent), strcmp(gcontent, "000")) { - escputs(gcontent); - wprintf("
\n"); + + switch (GetServerStatus(Buf, NULL)) { + case 8: + serv_puts("\n\n000"); + if ( (StrLength(Buf)==3) && + !strcmp(ChrPtr(Buf), "000")) { + StrBufAppendBufPlain(WCC->WBuf, HKEY("\000"), 0); + break; } - wprintf("000"); - } - if (buf[0] == '4') { + case 1: + while (!Done) { + StrBuf_ServGetlnBuffered(Buf); + if ( (StrLength(Buf)==3) && + !strcmp(ChrPtr(Buf), "000")) { + Done = 1; + } + StrEscAppend(WCC->WBuf, Buf, NULL, 0, 0); + StrBufAppendBufPlain(WCC->WBuf, HKEY("
\n"), 0); + } + break; + case 4: text_to_server(bstr("g_input")); serv_puts("000"); - } - if (buf[0] == '6') { - len = atol(&buf[4]); - junk = malloc(len); - serv_read(junk, len); - free(junk); - } - if (buf[0] == '7') { - len = atol(&buf[4]); + break; + case 6: + len = atol(&ChrPtr(Buf)[4]); + StrBuf_ServGetBLOBBuffered(Buf, len); + break; + case 7: + len = atol(&ChrPtr(Buf)[4]); junk = malloc(len); memset(junk, 0, len); serv_write(junk, len); free(junk); } + wprintf("
"); wprintf("Enter another command
\n"); wprintf("Return to menu\n"); diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 345b1d56e..b1205c7e8 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -143,15 +143,6 @@ inline void _serv_read(char *buf, int bytes, wcsession *WCC) } } -void serv_read(char *buf, int bytes) -{ - wcsession *WCC = WC; - - WCC->ReadPos = NULL; - - _serv_read(buf, bytes, WCC); -} - /* * input string from pipe */ diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index 5846fa80a..311fb3aa8 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -699,7 +699,6 @@ void do_addrbook_view(addrbookent *addrbook, int num_ab) { void do_edit_vcard(long msgnum, char *partnum, char *return_to, const char *force_room) { StrBuf *Buf; char buf[SIZ]; - StrBuf *serialized_vcard = NULL; size_t total_len = 0; struct vCard *v; int i; diff --git a/webcit/webcit.c b/webcit/webcit.c index f304e6506..b2060a16b 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -469,7 +469,6 @@ void ajax_servcmd(void) !strcmp(ChrPtr(Buf), "000")) { Done = 1; } - lprintf (1,"ajax: [%s]\n",ChrPtr(Buf)); StrBufAppendBuf(WCC->WBuf, Buf, 0); StrBufAppendBufPlain(WCC->WBuf, HKEY("\n"), 0); } diff --git a/webcit/webcit.h b/webcit/webcit.h index 77451ed53..f0e19f6dd 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -589,7 +589,6 @@ void msgescputs(char *strbuf); void msgescputs1(char *strbuf); void dump_vars(void); void embed_main_menu(void); -void serv_read(char *buf, int bytes); void SetAccessCommand(long Oper); void do_addrbook_view(addrbookent *addrbook, int num_ab);