Skip to content

Commit e6ea58f

Browse files
committed
Report the actual HTTP connection error in the error message.
1 parent 41f0be6 commit e6ea58f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Changes in HTMLDOC
44
v1.9.21 (YYYY-MM-DD)
55
--------------------
66

7+
- Update HTTP/HTTPS connection error reporting to include the reason.
78
- Updated markdown parser.
89
- Fixed a bug in the new PDF link code (Issue #536)
910

htmldoc/file.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
/*
22
* Filename routines for HTMLDOC, a HTML document processing program.
33
*
4-
* Copyright © 2011-2024 by Michael R Sweet.
4+
* Copyright © 2011-2025 by Michael R Sweet.
55
* Copyright © 1997-2010 by Easy Software Products. All rights reserved.
66
*
77
* This program is free software. Distribution and use rights are outlined in
88
* the file "COPYING".
99
*/
1010

1111
#include "file.h"
12-
#include <cups/http.h>
12+
#include <cups/cups.h>
1313
#include "progress.h"
1414
#include "debug.h"
1515

@@ -25,6 +25,10 @@
2525
#include <sys/stat.h>
2626
#include <ctype.h>
2727

28+
#if CUPS_VERSION_MAJOR == 2 && CUPS_VERSION_MINOR < 5
29+
# define cupsGetError cupsGetLastError
30+
# define cupsGetErrorString cupsGetLastErrorString
31+
#endif // CUPS_VERSION_MAJOR == 2 && CUPS_VERSION_MINOR < 5
2832

2933

3034
/*
@@ -497,7 +501,7 @@ file_find_check(const char *filename) /* I - File or URL */
497501
if ((http = httpConnect2(connhost, connport, NULL, AF_UNSPEC, encryption, 1, 30000, NULL)) == NULL)
498502
{
499503
progress_hide();
500-
progress_error(HD_ERROR_NETWORK_ERROR, "Unable to connect to %s:%d", connhost, connport);
504+
progress_error(HD_ERROR_NETWORK_ERROR, "Unable to connect to %s:%d - %s", connhost, connport, cupsGetErrorString());
501505
return (NULL);
502506
}
503507
}

0 commit comments

Comments
 (0)