thanks Sam. I put the change in place:
- static int download_func(const char *p, size_t cnt, void
*voidptr)
- {
- while (cnt--)
- /* if (putchar(*p++) == EOF)*/
- if putchar((int)(unsigned char)*p++)
- {
- cleanup();
- fake_exit(0);
- }
- return (0);
- }
- {
i forgot to mention the compiler, gcc 3.2.1:
Configured with: ../gcc-3.2.1/configure --with-gnu-as --with-as=/usr/local/bin/as --with-gnu-ld --with-ld=/usr/local/bin/ld --disable-multilib --disable-libgcj --disable-nls
Thread model: posix
gcc version 3.2.1
and, i forgot to supply my config args, in case they are relevant:
./configure \
--without-authshadow \
--without-authpwd \
--without-authpam \
--without-authuserdb \
--without-authmysql \
--without-authldap \
--with-authvchkpw \
--with-db=gdbm \
--with-cachedir=/u1/sqwebmail.cache \
--with-gzip \
--enable-https=auto \
--enable-hardtimeout=86400 \
--enable-softtimeout=86400 \
--enable-autopurge=2 \
--enable-maxpurge=7 \
--enable-cgibindir=/usr/local/apache/cgi-bin \
--enable-imagedir=/usr/local/apache/cgi-bin/webmail \
--enable-imageurl=/webmail \
--enable-mimetypes=/usr/local/apache/conf/mime.types \
--with-maxargsize=100000000 \
--with-maxformargsize=100000000 \
--with-maxmsgsize=250000000 \
--with-ispell=/usr/local/bin/aspell
At 01:54 PM 01-26-2003, Sam Varshavchik wrote:
Whatever it is, it is particular to your platform or server. I can download the entire message, save it in the local account, and open the attachments just fine. Your server closes the connection without downloading anything.
=======================
GET /sqwebmail.cgi/login/testuser%40smileglobal.com.authdaemon/... HTTP/1.0
Host: sqwebmail.smileglobal.com
HTTP/1.1 200 OK
Date: Sun, 26 Jan 2003 21:37:46 GMT
Server: Apache/1.3.27 (Unix) PHP/4.3.0
Cache-Control: no-store
Pragma: no-cache
Connection: close
Content-Type: image/jpeg; charset="iso-8859-1"; name="DSCF0076.JPG"
Connection closed by foreign host.
=======================
This tells me that the download code does start to run, but something stops it. The interesting thing is that the most of the same code is used to download the entire message; and as I said that happened without any problems.
I'll bet this is your problem:
static int download_func(const char *p, size_t cnt, void *voidptr)
{
while (cnt--)
if (putchar(*p++) == EOF)
{
cleanup();
fake_exit(0);
}
return (0);
}
I bet that your putchar() improperly sign-extends char values, so an occurence of binary 0xFF gets sign-extended to EOF.
Change that to putchar((int)(unsigned char)*p++)
http://www.anastrophe.com
http://folding.stanford.edu
The Nicest Misanthrope on the Net
