/*
- * $Id: rfc1123.c,v 1.31 2003/01/23 00:37:01 robertc Exp $
+ * $Id: rfc1123.c,v 1.32 2003/02/03 21:33:15 robertc Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
#elif defined (_timezone)
#elif defined(_SQUID_AIX_)
#elif defined(_SQUID_CYGWIN_)
+#elif defined(_SQUID_MSWIN_)
#else
extern time_t timezone;
#endif
*/
if (tm->tm_isdst > 0)
dst = -3600;
-#if defined ( _timezone) || defined(_SQUID_CYGWIN_)
+#if defined ( _timezone) || defined(_SQUID_CYGWIN_) || defined(_SQUID_MSWIN_)
t -= (_timezone + dst);
#else
t -= (timezone + dst);
/*
- * $Id: client.cc,v 1.103 2003/01/23 00:37:17 robertc Exp $
+ * $Id: client.cc,v 1.104 2003/02/03 21:33:15 robertc Exp $
*
* DEBUG: section 0 WWW Client
* AUTHOR: Harvest Derived
static SIGHDLR catchSignal;
static SIGHDLR pipe_handler;
static void set_our_signal(void);
+#ifndef _SQUID_MSWIN_
static ssize_t myread(int fd, void *buf, size_t len);
static ssize_t mywrite(int fd, void *buf, size_t len);
+#endif
static int put_fd;
static char *put_file = NULL;
static struct stat sb;
break;
}
}
+#ifdef _SQUID_MSWIN_
+ {
+ WSADATA wsaData;
+ WSAStartup(2, &wsaData);
+ }
+#endif
/* Build the HTTP request */
if (strncmp(url, "mgr:", 4) == 0) {
char *t = xstrdup(url + 4);
(void) sigaction(SIGINT, &sa, NULL);
}
#else
- void (*osig) ();
+ void (*osig) (int);
if ((osig = signal(SIGINT, catchSignal)) != SIG_DFL)
(void) signal(SIGINT, osig);
#endif
exit(1);
}
/* Send the HTTP request */
+#ifdef _SQUID_MSWIN_
+ bytesWritten = send(conn, msg, strlen(msg), 0);
+#else
bytesWritten = mywrite(conn, msg, strlen(msg));
+#endif
if (bytesWritten < 0) {
perror("client: ERROR: write");
exit(1);
if (put_file) {
int x;
lseek(put_fd, 0, SEEK_SET);
+#ifdef _SQUID_MSWIN_
+ while ((x = read(put_fd, buf, sizeof(buf))) > 0) {
+ x = write(conn, buf, x);
+#else
while ((x = myread(put_fd, buf, sizeof(buf))) > 0) {
x = mywrite(conn, buf, x);
+#endif
total_bytes += x;
if (x <= 0)
break;
}
/* Read the data */
+#ifdef _SQUID_MSWIN_
+ setmode(1, O_BINARY);
+ while ((len = recv(conn, buf, sizeof(buf), 0)) > 0) {
+#else
while ((len = myread(conn, buf, sizeof(buf))) > 0) {
+#endif
fsize += len;
if (to_stdout)
fwrite(buf, len, 1, stdout);
}
+#ifdef _SQUID_MSWIN_
+ setmode(1, O_TEXT);
+#endif
(void) close(conn); /* done with socket */
if (interrupted)
}
+#ifndef _SQUID_MSWIN_
static ssize_t
myread(int fd, void *buf, size_t len)
{
alarm(io_timeout);
return write(fd, buf, len);
}
+#endif
/*
- * $Id: debug.cc,v 1.87 2003/01/23 00:37:19 robertc Exp $
+ * $Id: debug.cc,v 1.88 2003/02/03 21:33:15 robertc Exp $
*
* DEBUG: section 0 Debug Routines
* AUTHOR: Harvest Derived
i--;
snprintf(from, MAXPATHLEN, "%s.%d", debug_log_file, i - 1);
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, i);
+#ifdef _SQUID_MSWIN_
+ remove(to);
+#endif
rename(from, to);
}
/*
/* Rotate the current log to .0 */
if (Config.Log.rotateNumber > 0) {
snprintf(to, MAXPATHLEN, "%s.%d", debug_log_file, 0);
+#ifdef _SQUID_MSWIN_
+ remove(to);
+#endif
rename(debug_log_file, to);
}
/* Close and reopen the log. It may have been renamed "manually"