-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
request.c: Use errno only if it is non-zero (fixes #893) #1009
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments. I think we need a little code refactoring here…
8562930
to
fa94eab
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments.
a339565
to
b7855aa
Compare
b7855aa
to
dce308e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few small nits - see comments.
ffe60df
to
b672448
Compare
Sometimes errno is not set when we want to report HTTP error, so we should use `http->error` if available or internal server error. In cases of internal HTTP related errors where we don't have HTTP connection available (before setting of HTTP connection or in callbacks which process IPP messages), use `_cupsSetError()`. Fixes OpenPrinting#893
b672448
to
8643c97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Currently breaks the build
|
@andi34 ouch! Thanks! I was too eager there, it should be fixed now. |
In case of internal errors, we use errno for generating error message, but there are cases (like operation timeout for listing drivers or models) when errno is zero.
We should take error from
http->error
if errno is zero, falling back toInternal Server Error
if evenhttp->error
is 0 and still we have HTTP_STATUS_ERROR.Fixes #893