View | Details | Raw Unified | Return to bug 32988
Collapse All | Expand All

(-)common.c (-3 / +3 lines)
Lines 208-214 Link Here
208
    struct addrinfo hints, *res, *res0;
208
    struct addrinfo hints, *res, *res0;
209
    int sd, err;
209
    int sd, err;
210
210
211
    DEBUG(fprintf(stderr, "\033[1m---> %s:%d\033[m\n", host, port));
211
    DEBUG(fprintf(stderr, "---> %s:%d\n", host, port));
212
212
213
    if (verbose)
213
    if (verbose)
214
	_fetch_info("looking up %s", host);
214
	_fetch_info("looking up %s", host);
Lines 324-330 Link Here
324
	}
324
	}
325
    } while (c != '\n');
325
    } while (c != '\n');
326
    
326
    
327
    DEBUG(fprintf(stderr, "\033[1m<<< %.*s\033[m", (int)*len, *buf));
327
    DEBUG(fprintf(stderr, "<<< %.*s", (int)*len, *buf));
328
    return 0;
328
    return 0;
329
}
329
}
330
330
Lines 348-354 Link Here
348
    wlen = writev(fd, iov, 2);
348
    wlen = writev(fd, iov, 2);
349
    if (wlen < 0 || (size_t)wlen != len)
349
    if (wlen < 0 || (size_t)wlen != len)
350
	return -1;
350
	return -1;
351
    DEBUG(fprintf(stderr, "\033[1m>>> %s\n\033[m", str));
351
    DEBUG(fprintf(stderr, ">>> %s\n", str));
352
    return 0;
352
    return 0;
353
}
353
}
354
354
(-)fetch.c (-6 / +6 lines)
Lines 403-414 Link Here
403
    }
403
    }
404
    
404
    
405
    DEBUG(fprintf(stderr,
405
    DEBUG(fprintf(stderr,
406
		  "scheme:   [\033[1m%s\033[m]\n"
406
		  "scheme:   [%s]\n"
407
		  "user:     [\033[1m%s\033[m]\n"
407
		  "user:     [%s]\n"
408
		  "password: [\033[1m%s\033[m]\n"
408
		  "password: [%s]\n"
409
		  "host:     [\033[1m%s\033[m]\n"
409
		  "host:     [%s]\n"
410
		  "port:     [\033[1m%d\033[m]\n"
410
		  "port:     [%d]\n"
411
		  "document: [\033[1m%s\033[m]\n",
411
		  "document: [%s]\n",
412
		  u->scheme, u->user, u->pwd,
412
		  u->scheme, u->user, u->pwd,
413
		  u->host, u->port, u->doc));
413
		  u->host, u->port, u->doc));
414
    
414
    
(-)ftp.c (-3 / +3 lines)
Lines 267-273 Link Here
267
    }
267
    }
268
    if (us->size == 0)
268
    if (us->size == 0)
269
	us->size = -1;
269
	us->size = -1;
270
    DEBUG(fprintf(stderr, "size: [\033[1m%lld\033[m]\n", (long long)us->size));
270
    DEBUG(fprintf(stderr, "size: [%lld]\n", (long long)us->size));
271
271
272
    if ((e = _ftp_cmd(cd, "MDTM %s", s)) != FTP_FILE_STATUS) {
272
    if ((e = _ftp_cmd(cd, "MDTM %s", s)) != FTP_FILE_STATUS) {
273
	_ftp_seterr(e);
273
	_ftp_seterr(e);
Lines 301-308 Link Here
301
	t = time(NULL);
301
	t = time(NULL);
302
    us->mtime = t;
302
    us->mtime = t;
303
    us->atime = t;
303
    us->atime = t;
304
    DEBUG(fprintf(stderr, "last modified: [\033[1m%04d-%02d-%02d "
304
    DEBUG(fprintf(stderr, "last modified: [%04d-%02d-%02d "
305
		  "%02d:%02d:%02d\033[m]\n",
305
		  "%02d:%02d:%02d]\n",
306
		  tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
306
		  tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
307
		  tm.tm_hour, tm.tm_min, tm.tm_sec));
307
		  tm.tm_hour, tm.tm_min, tm.tm_sec));
308
    return 0;
308
    return 0;
(-)http.c (-10 / +10 lines)
Lines 146-156 Link Here
146
    if (fetchDebug) {
146
    if (fetchDebug) {
147
	c->total += c->chunksize;
147
	c->total += c->chunksize;
148
	if (c->chunksize == 0)
148
	if (c->chunksize == 0)
149
	    fprintf(stderr, "\033[1m_http_fillbuf(): "
149
	    fprintf(stderr, "_http_fillbuf(): "
150
		    "end of last chunk\033[m\n");
150
		    "end of last chunk\n");
151
	else
151
	else
152
	    fprintf(stderr, "\033[1m_http_fillbuf(): "
152
	    fprintf(stderr, "_http_fillbuf(): "
153
		    "new chunk: %lu (%lu)\033[m\n",
153
		    "new chunk: %lu (%lu)\n",
154
		    (unsigned long)c->chunksize, (unsigned long)c->total);
154
		    (unsigned long)c->chunksize, (unsigned long)c->total);
155
    }
155
    }
156
#endif
156
#endif
Lines 447-454 Link Here
447
    setlocale(LC_TIME, locale);
447
    setlocale(LC_TIME, locale);
448
    if (r == NULL)
448
    if (r == NULL)
449
	return -1;
449
	return -1;
450
    DEBUG(fprintf(stderr, "last modified: [\033[1m%04d-%02d-%02d "
450
    DEBUG(fprintf(stderr, "last modified: [%04d-%02d-%02d "
451
		  "%02d:%02d:%02d\033[m]\n",
451
		  "%02d:%02d:%02d]\n",
452
		  tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
452
		  tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
453
		  tm.tm_hour, tm.tm_min, tm.tm_sec));
453
		  tm.tm_hour, tm.tm_min, tm.tm_sec));
454
    *mtime = timegm(&tm);
454
    *mtime = timegm(&tm);
Lines 467-473 Link Here
467
	len = len * 10 + (*p - '0');
467
	len = len * 10 + (*p - '0');
468
    if (*p)
468
    if (*p)
469
	return -1;
469
	return -1;
470
    DEBUG(fprintf(stderr, "content length: [\033[1m%lld\033[m]\n",
470
    DEBUG(fprintf(stderr, "content length: [%lld]\n",
471
		  (long long)len));
471
		  (long long)len));
472
    *length = len;
472
    *length = len;
473
    return 0;
473
    return 0;
Lines 495-501 Link Here
495
	len = len * 10 + *p - '0';
495
	len = len * 10 + *p - '0';
496
    if (*p || len < last - first + 1)
496
    if (*p || len < last - first + 1)
497
	return -1;
497
	return -1;
498
    DEBUG(fprintf(stderr, "content range: [\033[1m%lld-%lld/%lld\033[m]\n",
498
    DEBUG(fprintf(stderr, "content range: [%lld-%lld/%lld]\n",
499
		  (long long)first, (long long)last, (long long)len));
499
		  (long long)first, (long long)last, (long long)len));
500
    *offset = first;
500
    *offset = first;
501
    *length = last - first + 1;
501
    *length = last - first + 1;
Lines 573-580 Link Here
573
    char *upw, *auth;
573
    char *upw, *auth;
574
    int r;
574
    int r;
575
575
576
    DEBUG(fprintf(stderr, "usr: [\033[1m%s\033[m]\n", usr));
576
    DEBUG(fprintf(stderr, "usr: [%s]\n", usr));
577
    DEBUG(fprintf(stderr, "pwd: [\033[1m%s\033[m]\n", pwd));
577
    DEBUG(fprintf(stderr, "pwd: [%s]\n", pwd));
578
    if (asprintf(&upw, "%s:%s", usr, pwd) == -1)
578
    if (asprintf(&upw, "%s:%s", usr, pwd) == -1)
579
	return -1;
579
	return -1;
580
    auth = _http_base64(upw);
580
    auth = _http_base64(upw);

Return to bug 32988