summaryrefslogtreecommitdiff
path: root/imap/src/osdep/nt/tcp_nt.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-09-06 21:36:38 -0600
committerEduardo Chappa <chappa@washington.edu>2019-09-06 21:36:38 -0600
commitf7b373f085992290c427392a28984c2ddc1553ba (patch)
tree60a9ccf460bff534b8f350a40b955986031a79d3 /imap/src/osdep/nt/tcp_nt.c
parenta7f1ee6fbe1aa46f7bcc0d40740e0b6c98a12692 (diff)
downloadalpine-f7b373f085992290c427392a28984c2ddc1553ba.tar.xz
* Fixes so that Alpine will build in the Windows operating system. This
update takes care of building with LibreSSL.
Diffstat (limited to 'imap/src/osdep/nt/tcp_nt.c')
-rw-r--r--imap/src/osdep/nt/tcp_nt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/imap/src/osdep/nt/tcp_nt.c b/imap/src/osdep/nt/tcp_nt.c
index 7af6de77..3a836b12 100644
--- a/imap/src/osdep/nt/tcp_nt.c
+++ b/imap/src/osdep/nt/tcp_nt.c
@@ -926,3 +926,26 @@ void tcp_end(void)
if(myServerAddr) fs_give((void **) &myServerAddr);
if(myServerHost) fs_give((void **) &myServerHost);
}
+
+
+char *tcp_getsize (TCPSTREAM *stream, unsigned long size)
+{
+ char *ret = NIL;
+ unsigned long got = 0L, need = size, n;
+ int done = 0;
+
+ while(!done){
+ if(!tcp_getdata (stream)) return ret; /* return what we have */
+ n = stream->ictr < need ? stream->ictr : need;
+ fs_resize((void **) &ret, got + n + 1);
+ memcpy(ret + got, stream->iptr, n);
+ ret[got+n] = '\0';
+ got += n;
+ need -= n;
+ stream->iptr += n;
+ stream->ictr -= n;
+ if(need == 0L) done++;
+ }
+
+ return ret;
+}