-int sock_read_to(int *sock, char *buf, int bytes, int timeout,
- int keep_reading_until_full)
-{
- CitContext *CCC = MyContext();
- int rc;
-
- FlushStrBuf(CCC->MigrateBuf);
- rc = socket_read_blob(sock, CCC->sMigrateBuf, bytes, timeout);
- if (rc < 0) {
- *buf = '\0';
- return rc;
- } else {
- if (StrLength(CCC->MigrateBuf) < bytes)
- bytes = StrLength(CCC->MigrateBuf);
- memcpy(buf, ChrPtr(CCC->MigrateBuf), bytes);
-
- FlushStrBuf(CCC->MigrateBuf);
- return rc;
- }
-}
-
-
-int CtdlSockGetLine(int *sock, StrBuf * Target)