Remove NGHTTP2_ERR_GZIP error code

This commit is contained in:
Tatsuhiro Tsujikawa 2014-05-06 23:42:57 +09:00
parent 43fb7f707f
commit 9228e223fa
4 changed files with 6 additions and 22 deletions

View File

@ -284,10 +284,6 @@ typedef enum {
* requested operation. * requested operation.
*/ */
NGHTTP2_ERR_INVALID_STATE = -519, NGHTTP2_ERR_INVALID_STATE = -519,
/**
* The gzip error.
*/
NGHTTP2_ERR_GZIP = -520,
/** /**
* The user callback function failed due to the temporal error. * The user callback function failed due to the temporal error.
*/ */

View File

@ -201,8 +201,6 @@ const char* nghttp2_strerror(int error_code)
return "Invalid header block"; return "Invalid header block";
case NGHTTP2_ERR_INVALID_STATE: case NGHTTP2_ERR_INVALID_STATE:
return "Invalid state"; return "Invalid state";
case NGHTTP2_ERR_GZIP:
return "Gzip error";
case NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE: case NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE:
return "The user callback function failed due to the temporal error"; return "The user callback function failed due to the temporal error";
case NGHTTP2_ERR_FRAME_SIZE_ERROR: case NGHTTP2_ERR_FRAME_SIZE_ERROR:

View File

@ -31,7 +31,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
int rv; int rv;
*inflater_ptr = malloc(sizeof(nghttp2_gzip)); *inflater_ptr = malloc(sizeof(nghttp2_gzip));
if(*inflater_ptr == NULL) { if(*inflater_ptr == NULL) {
return NGHTTP2_ERR_NOMEM; return -1;
} }
(*inflater_ptr)->finished = 0; (*inflater_ptr)->finished = 0;
(*inflater_ptr)->zst.next_in = Z_NULL; (*inflater_ptr)->zst.next_in = Z_NULL;
@ -42,7 +42,7 @@ int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr)
rv = inflateInit2(&(*inflater_ptr)->zst, 47); rv = inflateInit2(&(*inflater_ptr)->zst, 47);
if(rv != Z_OK) { if(rv != Z_OK) {
free(*inflater_ptr); free(*inflater_ptr);
return NGHTTP2_ERR_GZIP; return -1;
} }
return 0; return 0;
} }
@ -61,7 +61,7 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
{ {
int rv; int rv;
if(inflater->finished) { if(inflater->finished) {
return NGHTTP2_ERR_GZIP; return -1;
} }
inflater->zst.avail_in = *inlen_ptr; inflater->zst.avail_in = *inlen_ptr;
inflater->zst.next_in = (unsigned char*)in; inflater->zst.next_in = (unsigned char*)in;
@ -82,7 +82,7 @@ int nghttp2_gzip_inflate(nghttp2_gzip *inflater,
case Z_STREAM_ERROR: case Z_STREAM_ERROR:
case Z_NEED_DICT: case Z_NEED_DICT:
case Z_MEM_ERROR: case Z_MEM_ERROR:
return NGHTTP2_ERR_GZIP; return -1;
default: default:
assert(0); assert(0);
/* We need this for some compilers */ /* We need this for some compilers */

View File

@ -51,13 +51,7 @@ typedef struct {
* A helper function to set up a per request gzip stream to inflate * A helper function to set up a per request gzip stream to inflate
* data. * data.
* *
* This function returns 0 if it succeeds, or one of the following * This function returns 0 if it succeeds, or -1.
* negative error codes:
*
* :enum:`NGHTTP2_ERR_GZIP`
* The initialization of gzip stream failed.
* :enum:`NGHTTP2_ERR_NOMEM`
* Out of memory.
*/ */
int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr); int nghttp2_gzip_inflate_new(nghttp2_gzip **inflater_ptr);
@ -77,11 +71,7 @@ void nghttp2_gzip_inflate_del(nghttp2_gzip *inflater);
* the number of data written in |out|. Similarly, |*inlen_ptr| is * the number of data written in |out|. Similarly, |*inlen_ptr| is
* updated to represent the number of input bytes processed. * updated to represent the number of input bytes processed.
* *
* This function returns 0 if it succeeds, or one of the following * This function returns 0 if it succeeds, or -1.
* negative error codes:
*
* :enum:`NGHTTP2_ERR_GZIP`
* The inflation of gzip stream failed.
* *
* The example follows:: * The example follows::
* *