X-Git-Url: https://code.citadel.org/?p=citadel.git;a=blobdiff_plain;f=webcit%2Fserv_func.c;h=654cb4f2dc0bad384290a9c36ab013eddefc02ec;hp=3a648717291b31da8736bd4011d5c6bef6a4a927;hb=23fcabeb4944b5e79e80a37127ed84ec8a639ed8;hpb=d36da34581cd277a2face04a11cdb8f81d8d2121 diff --git a/webcit/serv_func.c b/webcit/serv_func.c index 3a6487172..654cb4f2d 100644 --- a/webcit/serv_func.c +++ b/webcit/serv_func.c @@ -533,53 +533,6 @@ void server_to_text() -/** - * Read binary data from server into memory using a series of - * server READ commands. - * \return the read content as StrBuf - */ -int read_server_binary(StrBuf *Ret, size_t total_len, StrBuf *Buf) -{ - wcsession *WCC = WC; - size_t bytes = 0; - size_t thisblock = 0; - - if (Ret == NULL) - return -1; - - while ((WCC->serv_sock!=-1) && - (bytes < total_len)) { - thisblock = 4095; - if ((total_len - bytes) < thisblock) { - thisblock = total_len - bytes; - if (thisblock == 0) { - FlushStrBuf(Ret); - return -1; - } - } - serv_printf("READ %d|%d", (int)bytes, (int)thisblock); - if (StrBuf_ServGetln(Buf) > 0) - { - if (GetServerStatus(Buf, NULL) == 6) - { - StrBufCutLeft(Buf, 4); - thisblock = StrTol(Buf); - if (WCC->serv_sock==-1) { - FlushStrBuf(Ret); - return -1; - } - StrBuf_ServGetBLOBBuffered(Ret, thisblock); - bytes += thisblock; - } - else { - lprintf(3, "Error: %s\n", ChrPtr(Buf) + 4); - return -1; - } - } - } - return StrLength(Ret); -} - /** * Read text from server, appending to a string buffer until the