[gs-cvs] rev 7633 - in trunk/gs: doc src
leonardo at ghostscript.com
leonardo at ghostscript.com
Mon Jan 22 02:29:52 PST 2007
Author: leonardo
Date: 2007-01-22 02:29:52 -0800 (Mon, 22 Jan 2007)
New Revision: 7633
Modified:
trunk/gs/doc/API.htm
trunk/gs/src/interp.c
Log:
Fix (PS interpreter) Discontinue the interpretation on interrupt.
DETAILS :
Bug 688817 "Endless 'interrupt in interrupt' with GSAPI".
When a GSAPI client tries to stop GS by returning a negative value
from the polling callback function, GS enters an infinite loop
handling cascading "interrupt" exceptions.
Thanks to SaGS for the patch.
EXPECTED DIFFERENCES :
None.
Modified: trunk/gs/doc/API.htm
===================================================================
--- trunk/gs/doc/API.htm 2007-01-22 07:55:43 UTC (rev 7632)
+++ trunk/gs/doc/API.htm 2007-01-22 10:29:52 UTC (rev 7633)
@@ -343,19 +343,22 @@
which will return <b><tt>e_NeedInput</tt></b> if all is well.
See below for <a href="#return_codes">return codes</a>.
<p>
-The address passed in <tt>pexit_code</tt> will be used to return the
+The address passed in <b><tt>pexit_code</tt></b> will be used to return the
exit code for the interpreter in case of a quit or fatal error. The
-<tt>user_errors</tt> argument is normally set to zero to indicate that
+<b><tt>user_errors</tt></b> argument is normally set to zero to indicate that
errors should be handled through the normal mechanisms within the
interpreted code. If set to a negative value, the functions will return
an error code directly to the caller, bypassing the interpreted
-language. A positive <tt>user_errors</tt> is treated the same as zero.
+language. The interpreted language's error handler is bypassed, regardless of
+<b><tt>user_errors</tt></b> parameter, for the <b><tt>e_interrupt</tt></b>
+generated when <a href="#set_poll">the polling callback</a> returns a negative
+value. A positive <b><tt>user_errors</tt></b> is treated the same as zero.
<p>
There is a 64 KB length limit on any buffer submitted to a
-<tt>gsapi_run_*</tt> function for processing. If you have more
+<b><tt>gsapi_run_*</tt></b> function for processing. If you have more
than 65535 bytes of input then you must split it into smaller
pieces and submit each in a separate
-<tt>gsapi_run_string_continue()</tt> call.
+<b><tt>gsapi_run_string_continue()</tt></b> call.
</blockquote>
<h3><a name="exit"></a><b><tt>gsapi_exit()</tt></b></h3>
@@ -396,6 +399,10 @@
<td>"<b><tt>quit</tt></b>" has been executed.
This is not an error.
<b><tt>gsapi_exit()</tt></b> must be called next.
+<tr valign=top> <td align=left>e_interrupt
+ <td>
+ <td><a href="#set_poll">The polling callback function</a>
+ returned a negative value, requesting Ghostscript to abort.
<tr valign=top> <td align=left>e_NeedInput
<td>
<td>More input is needed by
Modified: trunk/gs/src/interp.c
===================================================================
--- trunk/gs/src/interp.c 2007-01-22 07:55:43 UTC (rev 7632)
+++ trunk/gs/src/interp.c 2007-01-22 10:29:52 UTC (rev 7633)
@@ -525,6 +525,7 @@
epref = &doref;
goto again;
case e_NeedInput:
+ case e_interrupt:
return code;
}
/* Adjust osp in case of operand stack underflow */
More information about the gs-cvs
mailing list