+
+#ifdef HTTP_BUFFERING
+/*
+ Buffering code added by fdc 15 Dec 2005 for non-SSL case only because HTTP
+ GETs were orders of magnitude too slow due to the single-byte read()s. The
+ file-descriptor swapping is pretty gross, but the more elegant solution
+ (calling a nettchk() like routine with the fd as a parameter) doesn't work,
+ because nettchk() relies on too many other routines that, like itself, are
+ hardwired for ttyfd.
+*/
+ getfrombuffer:
+ if (--http_count >= 0) {
+ c = http_inbuf[http_bufp++];
+ x = 1;
+ } else {
+ int savefd;
+ savefd = ttyfd;
+ ttyfd = httpfd;
+ x = nettchk();
+ ttyfd = savefd;
+ debug(F101,"http_inc nettchk","",x);
+ if (x > HTTP_INBUFLEN)
+ x = HTTP_INBUFLEN;
+#ifdef TCPIPLIB
+ x = socket_read(httpfd,http_inbuf,x);
+#else /* Not TCPIPLIB */
+ x = read(httpfd,http_inbuf,x);
+#endif /* TCPIPLIB */
+ http_count = 0;
+ http_bufp = 0;
+ if (x > 0) {
+ c = http_inbuf[http_bufp++];
+ http_count = x - 1;
+ }
+ }
+#else /* Not HTTP_BUFFERING */