http.c (6490b215b31ab049cd10a3f77632ca04b24fe3a7) http.c (6a0cf64bce349bbe8de9a76bdda1b7b31010cf86)
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 763 unchanged lines hidden (view full) ---

772 _http_basic_auth(fd, "Authorization", url->user, url->pwd);
773 } else {
774 _http_seterr(HTTP_NEED_AUTH);
775 goto ouch;
776 }
777 }
778
779 /* other headers */
1/*-
2 * Copyright (c) 2000 Dag-Erling Co�dan Sm�rgrav
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 763 unchanged lines hidden (view full) ---

772 _http_basic_auth(fd, "Authorization", url->user, url->pwd);
773 } else {
774 _http_seterr(HTTP_NEED_AUTH);
775 goto ouch;
776 }
777 }
778
779 /* other headers */
780 _http_cmd(fd, "User-Agent: %s " _LIBFETCH_VER, __progname);
780 if ((p = getenv("HTTP_USER_AGENT")) != NULL && *p != '\0')
781 _http_cmd(fd, "User-Agent: %s", p);
782 else
783 _http_cmd(fd, "User-Agent: %s " _LIBFETCH_VER, __progname);
781 if (url->offset)
782 _http_cmd(fd, "Range: bytes=%lld-", url->offset);
783 _http_cmd(fd, "Connection: close");
784 _http_cmd(fd, "");
785
786 /* get reply */
787 switch ((code = _http_get_reply(fd))) {
788 case HTTP_OK:

--- 245 unchanged lines hidden ---
784 if (url->offset)
785 _http_cmd(fd, "Range: bytes=%lld-", url->offset);
786 _http_cmd(fd, "Connection: close");
787 _http_cmd(fd, "");
788
789 /* get reply */
790 switch ((code = _http_get_reply(fd))) {
791 case HTTP_OK:

--- 245 unchanged lines hidden ---